
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ c0 (* w h)) (pow (/ d D) 2.0)))
(t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))
INFINITY)
(* c0 (/ (+ t_0 (sqrt (- (pow t_0 2.0) (pow M 2.0)))) (* 2.0 w)))
(* c0 (/ 0.0 (* 2.0 w))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (w * h)) * pow((d / D), 2.0);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if (((c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= ((double) INFINITY)) {
tmp = c0 * ((t_0 + sqrt((pow(t_0, 2.0) - pow(M, 2.0)))) / (2.0 * w));
} else {
tmp = c0 * (0.0 / (2.0 * w));
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (w * h)) * Math.pow((d / D), 2.0);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if (((c0 / (2.0 * w)) * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = c0 * ((t_0 + Math.sqrt((Math.pow(t_0, 2.0) - Math.pow(M, 2.0)))) / (2.0 * w));
} else {
tmp = c0 * (0.0 / (2.0 * w));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (w * h)) * math.pow((d / D), 2.0) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if ((c0 / (2.0 * w)) * (t_1 + math.sqrt(((t_1 * t_1) - (M * M))))) <= math.inf: tmp = c0 * ((t_0 + math.sqrt((math.pow(t_0, 2.0) - math.pow(M, 2.0)))) / (2.0 * w)) else: tmp = c0 * (0.0 / (2.0 * w)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(w * h)) * (Float64(d / D) ^ 2.0)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) <= Inf) tmp = Float64(c0 * Float64(Float64(t_0 + sqrt(Float64((t_0 ^ 2.0) - (M ^ 2.0)))) / Float64(2.0 * w))); else tmp = Float64(c0 * Float64(0.0 / Float64(2.0 * w))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / (w * h)) * ((d / D) ^ 2.0); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if (((c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= Inf) tmp = c0 * ((t_0 + sqrt(((t_0 ^ 2.0) - (M ^ 2.0)))) / (2.0 * w)); else tmp = c0 * (0.0 / (2.0 * w)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c0 * N[(N[(t$95$0 + N[Sqrt[N[(N[Power[t$95$0, 2.0], $MachinePrecision] - N[Power[M, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;c0 \cdot \frac{t\_0 + \sqrt{{t\_0}^{2} - {M}^{2}}}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{0}{2 \cdot w}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 80.2%
Simplified79.2%
fma-undefine82.2%
associate-*r/80.2%
*-commutative80.2%
associate-*r*79.2%
associate-*r*76.6%
associate-/l*76.6%
frac-times76.4%
times-frac80.0%
pow280.0%
Applied egg-rr82.0%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified20.9%
Taylor expanded in c0 around -inf 0.1%
distribute-lft-in0.1%
mul-1-neg0.1%
distribute-rgt-neg-in0.1%
associate-/l*0.1%
mul-1-neg0.1%
associate-/l*0.1%
distribute-lft1-in0.1%
metadata-eval0.1%
mul0-lft43.0%
metadata-eval43.0%
Simplified43.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_1 (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
(if (<= t_1 INFINITY) t_1 (* c0 (/ 0.0 (* 2.0 w))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = c0 * (0.0 / (2.0 * w));
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_1 = (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = c0 * (0.0 / (2.0 * w));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) t_1 = (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M)))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = c0 * (0.0 / (2.0 * w)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(c0 * Float64(0.0 / Float64(2.0 * w))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = c0 * (0.0 / (2.0 * w)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c0 * N[(0.0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M \cdot M}\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{0}{2 \cdot w}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 80.2%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
Simplified20.9%
Taylor expanded in c0 around -inf 0.1%
distribute-lft-in0.1%
mul-1-neg0.1%
distribute-rgt-neg-in0.1%
associate-/l*0.1%
mul-1-neg0.1%
associate-/l*0.1%
distribute-lft1-in0.1%
metadata-eval0.1%
mul0-lft43.0%
metadata-eval43.0%
Simplified43.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* w h))) (t_1 (* t_0 (* (/ d D) (/ d D)))))
(if (or (<= c0 -3e+99) (not (<= c0 1.9e-24)))
(*
(/ c0 (* 2.0 w))
(+ t_1 (sqrt (- (* t_1 (* t_0 (/ (* d d) (* D D)))) (* M M)))))
(* c0 (/ 0.0 (* 2.0 w))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double tmp;
if ((c0 <= -3e+99) || !(c0 <= 1.9e-24)) {
tmp = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * (t_0 * ((d * d) / (D * D)))) - (M * M))));
} else {
tmp = c0 * (0.0 / (2.0 * w));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = c0 / (w * h)
t_1 = t_0 * ((d_1 / d) * (d_1 / d))
if ((c0 <= (-3d+99)) .or. (.not. (c0 <= 1.9d-24))) then
tmp = (c0 / (2.0d0 * w)) * (t_1 + sqrt(((t_1 * (t_0 * ((d_1 * d_1) / (d * d)))) - (m * m))))
else
tmp = c0 * (0.0d0 / (2.0d0 * w))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double tmp;
if ((c0 <= -3e+99) || !(c0 <= 1.9e-24)) {
tmp = (c0 / (2.0 * w)) * (t_1 + Math.sqrt(((t_1 * (t_0 * ((d * d) / (D * D)))) - (M * M))));
} else {
tmp = c0 * (0.0 / (2.0 * w));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (w * h) t_1 = t_0 * ((d / D) * (d / D)) tmp = 0 if (c0 <= -3e+99) or not (c0 <= 1.9e-24): tmp = (c0 / (2.0 * w)) * (t_1 + math.sqrt(((t_1 * (t_0 * ((d * d) / (D * D)))) - (M * M)))) else: tmp = c0 * (0.0 / (2.0 * w)) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(w * h)) t_1 = Float64(t_0 * Float64(Float64(d / D) * Float64(d / D))) tmp = 0.0 if ((c0 <= -3e+99) || !(c0 <= 1.9e-24)) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_1 + sqrt(Float64(Float64(t_1 * Float64(t_0 * Float64(Float64(d * d) / Float64(D * D)))) - Float64(M * M))))); else tmp = Float64(c0 * Float64(0.0 / Float64(2.0 * w))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (w * h); t_1 = t_0 * ((d / D) * (d / D)); tmp = 0.0; if ((c0 <= -3e+99) || ~((c0 <= 1.9e-24))) tmp = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * (t_0 * ((d * d) / (D * D)))) - (M * M)))); else tmp = c0 * (0.0 / (2.0 * w)); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[c0, -3e+99], N[Not[LessEqual[c0, 1.9e-24]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * N[(t$95$0 * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h}\\
t_1 := t\_0 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\\
\mathbf{if}\;c0 \leq -3 \cdot 10^{+99} \lor \neg \left(c0 \leq 1.9 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(t\_1 + \sqrt{t\_1 \cdot \left(t\_0 \cdot \frac{d \cdot d}{D \cdot D}\right) - M \cdot M}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{0}{2 \cdot w}\\
\end{array}
\end{array}
if c0 < -3.00000000000000014e99 or 1.90000000000000013e-24 < c0 Initial program 36.3%
Simplified37.1%
times-frac37.9%
Applied egg-rr37.9%
times-frac37.9%
Applied egg-rr37.9%
if -3.00000000000000014e99 < c0 < 1.90000000000000013e-24Initial program 24.6%
Simplified33.2%
Taylor expanded in c0 around -inf 5.7%
distribute-lft-in5.7%
mul-1-neg5.7%
distribute-rgt-neg-in5.7%
associate-/l*4.9%
mul-1-neg4.9%
associate-/l*6.4%
distribute-lft1-in6.4%
metadata-eval6.4%
mul0-lft42.4%
metadata-eval42.4%
Simplified42.4%
Final simplification40.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* w h)))
(t_1 (* t_0 (* (/ d D) (/ d D))))
(t_2 (/ c0 (* 2.0 w)))
(t_3 (* t_0 (/ (* d d) (* D D)))))
(if (<= c0 -2.2e+99)
(* t_2 (+ t_1 (sqrt (- (* t_1 t_3) (* M M)))))
(if (<= c0 2.8e-25)
(* c0 (/ 0.0 (* 2.0 w)))
(* t_2 (+ t_3 (sqrt (- (* t_3 t_3) (* M M)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double t_2 = c0 / (2.0 * w);
double t_3 = t_0 * ((d * d) / (D * D));
double tmp;
if (c0 <= -2.2e+99) {
tmp = t_2 * (t_1 + sqrt(((t_1 * t_3) - (M * M))));
} else if (c0 <= 2.8e-25) {
tmp = c0 * (0.0 / (2.0 * w));
} else {
tmp = t_2 * (t_3 + sqrt(((t_3 * t_3) - (M * M))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = c0 / (w * h)
t_1 = t_0 * ((d_1 / d) * (d_1 / d))
t_2 = c0 / (2.0d0 * w)
t_3 = t_0 * ((d_1 * d_1) / (d * d))
if (c0 <= (-2.2d+99)) then
tmp = t_2 * (t_1 + sqrt(((t_1 * t_3) - (m * m))))
else if (c0 <= 2.8d-25) then
tmp = c0 * (0.0d0 / (2.0d0 * w))
else
tmp = t_2 * (t_3 + sqrt(((t_3 * t_3) - (m * m))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double t_2 = c0 / (2.0 * w);
double t_3 = t_0 * ((d * d) / (D * D));
double tmp;
if (c0 <= -2.2e+99) {
tmp = t_2 * (t_1 + Math.sqrt(((t_1 * t_3) - (M * M))));
} else if (c0 <= 2.8e-25) {
tmp = c0 * (0.0 / (2.0 * w));
} else {
tmp = t_2 * (t_3 + Math.sqrt(((t_3 * t_3) - (M * M))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (w * h) t_1 = t_0 * ((d / D) * (d / D)) t_2 = c0 / (2.0 * w) t_3 = t_0 * ((d * d) / (D * D)) tmp = 0 if c0 <= -2.2e+99: tmp = t_2 * (t_1 + math.sqrt(((t_1 * t_3) - (M * M)))) elif c0 <= 2.8e-25: tmp = c0 * (0.0 / (2.0 * w)) else: tmp = t_2 * (t_3 + math.sqrt(((t_3 * t_3) - (M * M)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(w * h)) t_1 = Float64(t_0 * Float64(Float64(d / D) * Float64(d / D))) t_2 = Float64(c0 / Float64(2.0 * w)) t_3 = Float64(t_0 * Float64(Float64(d * d) / Float64(D * D))) tmp = 0.0 if (c0 <= -2.2e+99) tmp = Float64(t_2 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_3) - Float64(M * M))))); elseif (c0 <= 2.8e-25) tmp = Float64(c0 * Float64(0.0 / Float64(2.0 * w))); else tmp = Float64(t_2 * Float64(t_3 + sqrt(Float64(Float64(t_3 * t_3) - Float64(M * M))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (w * h); t_1 = t_0 * ((d / D) * (d / D)); t_2 = c0 / (2.0 * w); t_3 = t_0 * ((d * d) / (D * D)); tmp = 0.0; if (c0 <= -2.2e+99) tmp = t_2 * (t_1 + sqrt(((t_1 * t_3) - (M * M)))); elseif (c0 <= 2.8e-25) tmp = c0 * (0.0 / (2.0 * w)); else tmp = t_2 * (t_3 + sqrt(((t_3 * t_3) - (M * M)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.2e+99], N[(t$95$2 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$3), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 2.8e-25], N[(c0 * N[(0.0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$3 + N[Sqrt[N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h}\\
t_1 := t\_0 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\\
t_2 := \frac{c0}{2 \cdot w}\\
t_3 := t\_0 \cdot \frac{d \cdot d}{D \cdot D}\\
\mathbf{if}\;c0 \leq -2.2 \cdot 10^{+99}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_3 - M \cdot M}\right)\\
\mathbf{elif}\;c0 \leq 2.8 \cdot 10^{-25}:\\
\;\;\;\;c0 \cdot \frac{0}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_3 + \sqrt{t\_3 \cdot t\_3 - M \cdot M}\right)\\
\end{array}
\end{array}
if c0 < -2.19999999999999978e99Initial program 26.7%
Simplified28.8%
times-frac30.9%
Applied egg-rr30.9%
times-frac30.9%
Applied egg-rr30.9%
if -2.19999999999999978e99 < c0 < 2.79999999999999988e-25Initial program 24.6%
Simplified33.2%
Taylor expanded in c0 around -inf 5.7%
distribute-lft-in5.7%
mul-1-neg5.7%
distribute-rgt-neg-in5.7%
associate-/l*4.9%
mul-1-neg4.9%
associate-/l*6.4%
distribute-lft1-in6.4%
metadata-eval6.4%
mul0-lft42.4%
metadata-eval42.4%
Simplified42.4%
if 2.79999999999999988e-25 < c0 Initial program 42.3%
Simplified42.3%
Final simplification40.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* w h)))
(t_1 (* t_0 (* (/ d D) (/ d D))))
(t_2 (/ c0 (* 2.0 w)))
(t_3 (* t_0 (/ (* d d) (* D D))))
(t_4 (sqrt (- (* t_1 t_3) (* M M)))))
(if (<= c0 -2e+99)
(* t_2 (+ t_1 t_4))
(if (<= c0 1.6e-24) (* c0 (/ 0.0 (* 2.0 w))) (* t_2 (+ t_3 t_4))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double t_2 = c0 / (2.0 * w);
double t_3 = t_0 * ((d * d) / (D * D));
double t_4 = sqrt(((t_1 * t_3) - (M * M)));
double tmp;
if (c0 <= -2e+99) {
tmp = t_2 * (t_1 + t_4);
} else if (c0 <= 1.6e-24) {
tmp = c0 * (0.0 / (2.0 * w));
} else {
tmp = t_2 * (t_3 + t_4);
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = c0 / (w * h)
t_1 = t_0 * ((d_1 / d) * (d_1 / d))
t_2 = c0 / (2.0d0 * w)
t_3 = t_0 * ((d_1 * d_1) / (d * d))
t_4 = sqrt(((t_1 * t_3) - (m * m)))
if (c0 <= (-2d+99)) then
tmp = t_2 * (t_1 + t_4)
else if (c0 <= 1.6d-24) then
tmp = c0 * (0.0d0 / (2.0d0 * w))
else
tmp = t_2 * (t_3 + t_4)
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double t_2 = c0 / (2.0 * w);
double t_3 = t_0 * ((d * d) / (D * D));
double t_4 = Math.sqrt(((t_1 * t_3) - (M * M)));
double tmp;
if (c0 <= -2e+99) {
tmp = t_2 * (t_1 + t_4);
} else if (c0 <= 1.6e-24) {
tmp = c0 * (0.0 / (2.0 * w));
} else {
tmp = t_2 * (t_3 + t_4);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (w * h) t_1 = t_0 * ((d / D) * (d / D)) t_2 = c0 / (2.0 * w) t_3 = t_0 * ((d * d) / (D * D)) t_4 = math.sqrt(((t_1 * t_3) - (M * M))) tmp = 0 if c0 <= -2e+99: tmp = t_2 * (t_1 + t_4) elif c0 <= 1.6e-24: tmp = c0 * (0.0 / (2.0 * w)) else: tmp = t_2 * (t_3 + t_4) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(w * h)) t_1 = Float64(t_0 * Float64(Float64(d / D) * Float64(d / D))) t_2 = Float64(c0 / Float64(2.0 * w)) t_3 = Float64(t_0 * Float64(Float64(d * d) / Float64(D * D))) t_4 = sqrt(Float64(Float64(t_1 * t_3) - Float64(M * M))) tmp = 0.0 if (c0 <= -2e+99) tmp = Float64(t_2 * Float64(t_1 + t_4)); elseif (c0 <= 1.6e-24) tmp = Float64(c0 * Float64(0.0 / Float64(2.0 * w))); else tmp = Float64(t_2 * Float64(t_3 + t_4)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (w * h); t_1 = t_0 * ((d / D) * (d / D)); t_2 = c0 / (2.0 * w); t_3 = t_0 * ((d * d) / (D * D)); t_4 = sqrt(((t_1 * t_3) - (M * M))); tmp = 0.0; if (c0 <= -2e+99) tmp = t_2 * (t_1 + t_4); elseif (c0 <= 1.6e-24) tmp = c0 * (0.0 / (2.0 * w)); else tmp = t_2 * (t_3 + t_4); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(t$95$1 * t$95$3), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[c0, -2e+99], N[(t$95$2 * N[(t$95$1 + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 1.6e-24], N[(c0 * N[(0.0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$3 + t$95$4), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h}\\
t_1 := t\_0 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\\
t_2 := \frac{c0}{2 \cdot w}\\
t_3 := t\_0 \cdot \frac{d \cdot d}{D \cdot D}\\
t_4 := \sqrt{t\_1 \cdot t\_3 - M \cdot M}\\
\mathbf{if}\;c0 \leq -2 \cdot 10^{+99}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 + t\_4\right)\\
\mathbf{elif}\;c0 \leq 1.6 \cdot 10^{-24}:\\
\;\;\;\;c0 \cdot \frac{0}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_3 + t\_4\right)\\
\end{array}
\end{array}
if c0 < -1.9999999999999999e99Initial program 26.7%
Simplified28.8%
times-frac30.9%
Applied egg-rr30.9%
times-frac30.9%
Applied egg-rr30.9%
if -1.9999999999999999e99 < c0 < 1.60000000000000006e-24Initial program 24.6%
Simplified33.2%
Taylor expanded in c0 around -inf 5.7%
distribute-lft-in5.7%
mul-1-neg5.7%
distribute-rgt-neg-in5.7%
associate-/l*4.9%
mul-1-neg4.9%
associate-/l*6.4%
distribute-lft1-in6.4%
metadata-eval6.4%
mul0-lft42.4%
metadata-eval42.4%
Simplified42.4%
if 1.60000000000000006e-24 < c0 Initial program 42.3%
Simplified42.3%
times-frac42.3%
Applied egg-rr42.3%
Final simplification40.2%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* w h)))
(t_1 (* t_0 (* (/ d D) (/ d D))))
(t_2 (/ c0 (* 2.0 w)))
(t_3 (* t_0 (/ (* d d) (* D D)))))
(if (<= c0 -2.15e+99)
(* t_2 (+ t_1 (sqrt (- (* t_1 t_3) (* M M)))))
(if (<= c0 1.5e-24)
(* c0 (/ 0.0 (* 2.0 w)))
(* t_2 (+ t_1 (sqrt (- (* t_3 t_3) (* M M)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double t_2 = c0 / (2.0 * w);
double t_3 = t_0 * ((d * d) / (D * D));
double tmp;
if (c0 <= -2.15e+99) {
tmp = t_2 * (t_1 + sqrt(((t_1 * t_3) - (M * M))));
} else if (c0 <= 1.5e-24) {
tmp = c0 * (0.0 / (2.0 * w));
} else {
tmp = t_2 * (t_1 + sqrt(((t_3 * t_3) - (M * M))));
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = c0 / (w * h)
t_1 = t_0 * ((d_1 / d) * (d_1 / d))
t_2 = c0 / (2.0d0 * w)
t_3 = t_0 * ((d_1 * d_1) / (d * d))
if (c0 <= (-2.15d+99)) then
tmp = t_2 * (t_1 + sqrt(((t_1 * t_3) - (m * m))))
else if (c0 <= 1.5d-24) then
tmp = c0 * (0.0d0 / (2.0d0 * w))
else
tmp = t_2 * (t_1 + sqrt(((t_3 * t_3) - (m * m))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d / D) * (d / D));
double t_2 = c0 / (2.0 * w);
double t_3 = t_0 * ((d * d) / (D * D));
double tmp;
if (c0 <= -2.15e+99) {
tmp = t_2 * (t_1 + Math.sqrt(((t_1 * t_3) - (M * M))));
} else if (c0 <= 1.5e-24) {
tmp = c0 * (0.0 / (2.0 * w));
} else {
tmp = t_2 * (t_1 + Math.sqrt(((t_3 * t_3) - (M * M))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (w * h) t_1 = t_0 * ((d / D) * (d / D)) t_2 = c0 / (2.0 * w) t_3 = t_0 * ((d * d) / (D * D)) tmp = 0 if c0 <= -2.15e+99: tmp = t_2 * (t_1 + math.sqrt(((t_1 * t_3) - (M * M)))) elif c0 <= 1.5e-24: tmp = c0 * (0.0 / (2.0 * w)) else: tmp = t_2 * (t_1 + math.sqrt(((t_3 * t_3) - (M * M)))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(w * h)) t_1 = Float64(t_0 * Float64(Float64(d / D) * Float64(d / D))) t_2 = Float64(c0 / Float64(2.0 * w)) t_3 = Float64(t_0 * Float64(Float64(d * d) / Float64(D * D))) tmp = 0.0 if (c0 <= -2.15e+99) tmp = Float64(t_2 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_3) - Float64(M * M))))); elseif (c0 <= 1.5e-24) tmp = Float64(c0 * Float64(0.0 / Float64(2.0 * w))); else tmp = Float64(t_2 * Float64(t_1 + sqrt(Float64(Float64(t_3 * t_3) - Float64(M * M))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (w * h); t_1 = t_0 * ((d / D) * (d / D)); t_2 = c0 / (2.0 * w); t_3 = t_0 * ((d * d) / (D * D)); tmp = 0.0; if (c0 <= -2.15e+99) tmp = t_2 * (t_1 + sqrt(((t_1 * t_3) - (M * M)))); elseif (c0 <= 1.5e-24) tmp = c0 * (0.0 / (2.0 * w)); else tmp = t_2 * (t_1 + sqrt(((t_3 * t_3) - (M * M)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.15e+99], N[(t$95$2 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$3), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 1.5e-24], N[(c0 * N[(0.0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h}\\
t_1 := t\_0 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\\
t_2 := \frac{c0}{2 \cdot w}\\
t_3 := t\_0 \cdot \frac{d \cdot d}{D \cdot D}\\
\mathbf{if}\;c0 \leq -2.15 \cdot 10^{+99}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_3 - M \cdot M}\right)\\
\mathbf{elif}\;c0 \leq 1.5 \cdot 10^{-24}:\\
\;\;\;\;c0 \cdot \frac{0}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 + \sqrt{t\_3 \cdot t\_3 - M \cdot M}\right)\\
\end{array}
\end{array}
if c0 < -2.1500000000000001e99Initial program 26.7%
Simplified28.8%
times-frac30.9%
Applied egg-rr30.9%
times-frac30.9%
Applied egg-rr30.9%
if -2.1500000000000001e99 < c0 < 1.49999999999999998e-24Initial program 24.6%
Simplified33.2%
Taylor expanded in c0 around -inf 5.7%
distribute-lft-in5.7%
mul-1-neg5.7%
distribute-rgt-neg-in5.7%
associate-/l*4.9%
mul-1-neg4.9%
associate-/l*6.4%
distribute-lft1-in6.4%
metadata-eval6.4%
mul0-lft42.4%
metadata-eval42.4%
Simplified42.4%
if 1.49999999999999998e-24 < c0 Initial program 42.3%
Simplified42.3%
times-frac42.3%
Applied egg-rr42.3%
Final simplification40.2%
(FPCore (c0 w h D d M) :precision binary64 (* c0 (/ 0.0 (* 2.0 w))))
double code(double c0, double w, double h, double D, double d, double M) {
return c0 * (0.0 / (2.0 * w));
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = c0 * (0.0d0 / (2.0d0 * w))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return c0 * (0.0 / (2.0 * w));
}
def code(c0, w, h, D, d, M): return c0 * (0.0 / (2.0 * w))
function code(c0, w, h, D, d, M) return Float64(c0 * Float64(0.0 / Float64(2.0 * w))) end
function tmp = code(c0, w, h, D, d, M) tmp = c0 * (0.0 / (2.0 * w)); end
code[c0_, w_, h_, D_, d_, M_] := N[(c0 * N[(0.0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \frac{0}{2 \cdot w}
\end{array}
Initial program 30.4%
Simplified43.0%
Taylor expanded in c0 around -inf 3.1%
distribute-lft-in3.1%
mul-1-neg3.1%
distribute-rgt-neg-in3.1%
associate-/l*3.1%
mul-1-neg3.1%
associate-/l*3.5%
distribute-lft1-in3.5%
metadata-eval3.5%
mul0-lft30.6%
metadata-eval30.6%
Simplified30.6%
herbie shell --seed 2024103
(FPCore (c0 w h D d M)
:name "Henrywood and Agarwal, Equation (13)"
:precision binary64
(* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))