
(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 9 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 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))
INFINITY)
(/ (* (* c0 2.0) (/ (* (/ (* d (* c0 d)) w) (pow D -2.0)) h)) (* 2.0 w))
(* -0.5 (/ 0.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 tmp;
if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= ((double) INFINITY)) {
tmp = ((c0 * 2.0) * ((((d * (c0 * d)) / w) * pow(D, -2.0)) / h)) / (2.0 * w);
} else {
tmp = -0.5 * (0.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 tmp;
if (((c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = ((c0 * 2.0) * ((((d * (c0 * d)) / w) * Math.pow(D, -2.0)) / h)) / (2.0 * w);
} else {
tmp = -0.5 * (0.0 / w);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if ((c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))) <= math.inf: tmp = ((c0 * 2.0) * ((((d * (c0 * d)) / w) * math.pow(D, -2.0)) / h)) / (2.0 * w) else: tmp = -0.5 * (0.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))) tmp = 0.0 if (Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) <= Inf) tmp = Float64(Float64(Float64(c0 * 2.0) * Float64(Float64(Float64(Float64(d * Float64(c0 * d)) / w) * (D ^ -2.0)) / h)) / Float64(2.0 * w)); else tmp = Float64(-0.5 * Float64(0.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)); tmp = 0.0; if (((c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))))) <= Inf) tmp = ((c0 * 2.0) * ((((d * (c0 * d)) / w) * (D ^ -2.0)) / h)) / (2.0 * w); else tmp = -0.5 * (0.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]}, If[LessEqual[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], Infinity], N[(N[(N[(c0 * 2.0), $MachinePrecision] * N[(N[(N[(N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision] * N[Power[D, -2.0], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(0.0 / w), $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)}\\
\mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;\frac{\left(c0 \cdot 2\right) \cdot \frac{\frac{d \cdot \left(c0 \cdot d\right)}{w} \cdot {D}^{-2}}{h}}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{0}{w}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 2 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 77.1%
times-frac69.1%
fma-def67.1%
times-frac67.3%
difference-of-squares67.3%
Simplified65.6%
*-un-lft-identity65.6%
associate-*l*64.5%
div-inv64.5%
clear-num64.5%
associate-*r/65.9%
*-commutative65.9%
times-frac65.9%
associate-/l/66.1%
fma-neg66.1%
associate-/l/65.9%
frac-times67.4%
pow267.4%
Applied egg-rr67.4%
*-lft-identity67.4%
*-commutative67.4%
fma-udef67.4%
unsub-neg67.4%
associate-/r*67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in c0 around inf 75.1%
associate-/r*74.1%
unpow274.1%
unpow274.1%
Simplified74.1%
expm1-log1p-u50.5%
expm1-udef50.0%
*-commutative50.0%
div-inv50.0%
*-commutative50.0%
pow250.0%
pow-flip50.0%
metadata-eval50.0%
Applied egg-rr50.0%
expm1-def50.5%
expm1-log1p74.1%
associate-*l/74.1%
associate-*r*74.1%
times-frac71.8%
associate-*r/76.9%
associate-*r*78.3%
*-commutative78.3%
Simplified78.3%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 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%
associate-*l*0.0%
difference-of-squares7.2%
associate-*l*7.2%
associate-*l*7.8%
Simplified7.8%
Taylor expanded in c0 around -inf 0.0%
*-commutative0.0%
unpow20.0%
distribute-rgt1-in0.0%
metadata-eval0.0%
mul0-lft30.7%
Simplified30.7%
Taylor expanded in c0 around 0 42.8%
Final simplification56.5%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= w -3.3e+81) (not (<= w 1.32e+65))) (* -0.5 (/ 0.0 w)) (/ (* c0 (* 2.0 (* (/ (/ c0 w) h) (pow (/ d D) 2.0)))) (* 2.0 w))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -3.3e+81) || !(w <= 1.32e+65)) {
tmp = -0.5 * (0.0 / w);
} else {
tmp = (c0 * (2.0 * (((c0 / w) / h) * pow((d / D), 2.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) :: tmp
if ((w <= (-3.3d+81)) .or. (.not. (w <= 1.32d+65))) then
tmp = (-0.5d0) * (0.0d0 / w)
else
tmp = (c0 * (2.0d0 * (((c0 / w) / h) * ((d_1 / d) ** 2.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 tmp;
if ((w <= -3.3e+81) || !(w <= 1.32e+65)) {
tmp = -0.5 * (0.0 / w);
} else {
tmp = (c0 * (2.0 * (((c0 / w) / h) * Math.pow((d / D), 2.0)))) / (2.0 * w);
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (w <= -3.3e+81) or not (w <= 1.32e+65): tmp = -0.5 * (0.0 / w) else: tmp = (c0 * (2.0 * (((c0 / w) / h) * math.pow((d / D), 2.0)))) / (2.0 * w) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((w <= -3.3e+81) || !(w <= 1.32e+65)) tmp = Float64(-0.5 * Float64(0.0 / w)); else tmp = Float64(Float64(c0 * Float64(2.0 * Float64(Float64(Float64(c0 / w) / h) * (Float64(d / D) ^ 2.0)))) / Float64(2.0 * w)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((w <= -3.3e+81) || ~((w <= 1.32e+65))) tmp = -0.5 * (0.0 / w); else tmp = (c0 * (2.0 * (((c0 / w) / h) * ((d / D) ^ 2.0)))) / (2.0 * w); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[w, -3.3e+81], N[Not[LessEqual[w, 1.32e+65]], $MachinePrecision]], N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[(2.0 * N[(N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -3.3 \cdot 10^{+81} \lor \neg \left(w \leq 1.32 \cdot 10^{+65}\right):\\
\;\;\;\;-0.5 \cdot \frac{0}{w}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \left(2 \cdot \left(\frac{\frac{c0}{w}}{h} \cdot {\left(\frac{d}{D}\right)}^{2}\right)\right)}{2 \cdot w}\\
\end{array}
\end{array}
if w < -3.3e81 or 1.31999999999999995e65 < w Initial program 11.2%
associate-*l*6.9%
difference-of-squares8.5%
associate-*l*8.3%
associate-*l*10.0%
Simplified10.0%
Taylor expanded in c0 around -inf 8.1%
*-commutative8.1%
unpow28.1%
distribute-rgt1-in8.1%
metadata-eval8.1%
mul0-lft44.5%
Simplified44.5%
Taylor expanded in c0 around 0 55.2%
if -3.3e81 < w < 1.31999999999999995e65Initial program 36.8%
times-frac33.7%
fma-def33.2%
associate-/r*33.2%
difference-of-squares38.6%
Simplified41.9%
Taylor expanded in c0 around inf 40.9%
*-commutative40.9%
*-commutative40.9%
times-frac42.6%
unpow242.6%
unpow242.6%
Simplified42.6%
fma-udef42.6%
associate-*r/42.8%
associate-*l/42.8%
pow242.8%
frac-times51.1%
pow251.1%
Applied egg-rr51.1%
count-251.1%
Simplified51.1%
associate-*l/51.6%
*-commutative51.6%
Applied egg-rr51.6%
expm1-log1p-u48.4%
expm1-udef44.9%
Applied egg-rr44.9%
expm1-def48.4%
expm1-log1p51.6%
associate-/r*52.7%
Simplified52.7%
Final simplification53.4%
(FPCore (c0 w h D d M)
:precision binary64
(if (or (<= w -1.5e+81)
(not
(or (<= w 2.65e-132) (and (not (<= w 1.55e-34)) (<= w 3.1e+66)))))
(* -0.5 (/ 0.0 w))
(* (/ c0 (* 2.0 w)) (* 2.0 (* (* (/ d D) (/ d D)) (/ c0 (* w h)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -1.5e+81) || !((w <= 2.65e-132) || (!(w <= 1.55e-34) && (w <= 3.1e+66)))) {
tmp = -0.5 * (0.0 / w);
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
}
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) :: tmp
if ((w <= (-1.5d+81)) .or. (.not. (w <= 2.65d-132) .or. (.not. (w <= 1.55d-34)) .and. (w <= 3.1d+66))) then
tmp = (-0.5d0) * (0.0d0 / w)
else
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 / d) * (d_1 / d)) * (c0 / (w * h))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -1.5e+81) || !((w <= 2.65e-132) || (!(w <= 1.55e-34) && (w <= 3.1e+66)))) {
tmp = -0.5 * (0.0 / w);
} else {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (w <= -1.5e+81) or not ((w <= 2.65e-132) or (not (w <= 1.55e-34) and (w <= 3.1e+66))): tmp = -0.5 * (0.0 / w) else: tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((w <= -1.5e+81) || !((w <= 2.65e-132) || (!(w <= 1.55e-34) && (w <= 3.1e+66)))) tmp = Float64(-0.5 * Float64(0.0 / w)); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 / Float64(w * h))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((w <= -1.5e+81) || ~(((w <= 2.65e-132) || (~((w <= 1.55e-34)) && (w <= 3.1e+66))))) tmp = -0.5 * (0.0 / w); else tmp = (c0 / (2.0 * w)) * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[w, -1.5e+81], N[Not[Or[LessEqual[w, 2.65e-132], And[N[Not[LessEqual[w, 1.55e-34]], $MachinePrecision], LessEqual[w, 3.1e+66]]]], $MachinePrecision]], N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.5 \cdot 10^{+81} \lor \neg \left(w \leq 2.65 \cdot 10^{-132} \lor \neg \left(w \leq 1.55 \cdot 10^{-34}\right) \land w \leq 3.1 \cdot 10^{+66}\right):\\
\;\;\;\;-0.5 \cdot \frac{0}{w}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)\\
\end{array}
\end{array}
if w < -1.49999999999999999e81 or 2.65000000000000015e-132 < w < 1.5499999999999999e-34 or 3.10000000000000019e66 < w Initial program 14.2%
associate-*l*10.9%
difference-of-squares12.1%
associate-*l*12.0%
associate-*l*14.4%
Simplified14.4%
Taylor expanded in c0 around -inf 7.3%
*-commutative7.3%
unpow27.3%
distribute-rgt1-in7.3%
metadata-eval7.3%
mul0-lft43.5%
Simplified43.5%
Taylor expanded in c0 around 0 53.1%
if -1.49999999999999999e81 < w < 2.65000000000000015e-132 or 1.5499999999999999e-34 < w < 3.10000000000000019e66Initial program 38.4%
times-frac35.4%
fma-def34.9%
associate-/r*34.9%
difference-of-squares41.0%
Simplified44.1%
Taylor expanded in c0 around inf 43.4%
*-commutative43.4%
*-commutative43.4%
times-frac45.3%
unpow245.3%
unpow245.3%
Simplified45.3%
fma-udef45.3%
associate-*r/45.5%
associate-*l/45.5%
pow245.5%
frac-times54.4%
pow254.4%
Applied egg-rr54.4%
count-254.4%
Simplified54.4%
unpow254.4%
Applied egg-rr54.4%
Final simplification54.0%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (* -0.5 (/ 0.0 w))))
(if (<= w -1.55e+80)
t_1
(if (<= w 9.2e-138)
(* t_0 (* 2.0 (* (* (/ d D) (/ d D)) (/ c0 (* w h)))))
(if (or (<= w 2.4e-28) (not (<= w 3.7e+64)))
t_1
(* t_0 (* 2.0 (* (/ (* c0 d) w) (/ d (* D (* h D)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = -0.5 * (0.0 / w);
double tmp;
if (w <= -1.55e+80) {
tmp = t_1;
} else if (w <= 9.2e-138) {
tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
} else if ((w <= 2.4e-28) || !(w <= 3.7e+64)) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D)))));
}
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 / (2.0d0 * w)
t_1 = (-0.5d0) * (0.0d0 / w)
if (w <= (-1.55d+80)) then
tmp = t_1
else if (w <= 9.2d-138) then
tmp = t_0 * (2.0d0 * (((d_1 / d) * (d_1 / d)) * (c0 / (w * h))))
else if ((w <= 2.4d-28) .or. (.not. (w <= 3.7d+64))) then
tmp = t_1
else
tmp = t_0 * (2.0d0 * (((c0 * d_1) / w) * (d_1 / (d * (h * d)))))
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 / (2.0 * w);
double t_1 = -0.5 * (0.0 / w);
double tmp;
if (w <= -1.55e+80) {
tmp = t_1;
} else if (w <= 9.2e-138) {
tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
} else if ((w <= 2.4e-28) || !(w <= 3.7e+64)) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = -0.5 * (0.0 / w) tmp = 0 if w <= -1.55e+80: tmp = t_1 elif w <= 9.2e-138: tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))) elif (w <= 2.4e-28) or not (w <= 3.7e+64): tmp = t_1 else: tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D))))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(-0.5 * Float64(0.0 / w)) tmp = 0.0 if (w <= -1.55e+80) tmp = t_1; elseif (w <= 9.2e-138) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 / Float64(w * h))))); elseif ((w <= 2.4e-28) || !(w <= 3.7e+64)) tmp = t_1; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 * d) / w) * Float64(d / Float64(D * Float64(h * D)))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = -0.5 * (0.0 / w); tmp = 0.0; if (w <= -1.55e+80) tmp = t_1; elseif (w <= 9.2e-138) tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))); elseif ((w <= 2.4e-28) || ~((w <= 3.7e+64))) tmp = t_1; else tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -1.55e+80], t$95$1, If[LessEqual[w, 9.2e-138], N[(t$95$0 * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, 2.4e-28], N[Not[LessEqual[w, 3.7e+64]], $MachinePrecision]], t$95$1, N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 * d), $MachinePrecision] / w), $MachinePrecision] * N[(d / N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := -0.5 \cdot \frac{0}{w}\\
\mathbf{if}\;w \leq -1.55 \cdot 10^{+80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq 9.2 \cdot 10^{-138}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)\\
\mathbf{elif}\;w \leq 2.4 \cdot 10^{-28} \lor \neg \left(w \leq 3.7 \cdot 10^{+64}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0 \cdot d}{w} \cdot \frac{d}{D \cdot \left(h \cdot D\right)}\right)\right)\\
\end{array}
\end{array}
if w < -1.54999999999999994e80 or 9.1999999999999996e-138 < w < 2.4000000000000002e-28 or 3.69999999999999983e64 < w Initial program 14.2%
associate-*l*10.9%
difference-of-squares12.1%
associate-*l*12.0%
associate-*l*14.4%
Simplified14.4%
Taylor expanded in c0 around -inf 7.3%
*-commutative7.3%
unpow27.3%
distribute-rgt1-in7.3%
metadata-eval7.3%
mul0-lft43.5%
Simplified43.5%
Taylor expanded in c0 around 0 53.1%
if -1.54999999999999994e80 < w < 9.1999999999999996e-138Initial program 37.1%
times-frac34.3%
fma-def33.7%
associate-/r*33.7%
difference-of-squares40.7%
Simplified43.6%
Taylor expanded in c0 around inf 42.7%
*-commutative42.7%
*-commutative42.7%
times-frac44.9%
unpow244.9%
unpow244.9%
Simplified44.9%
fma-udef44.9%
associate-*r/45.1%
associate-*l/45.1%
pow245.1%
frac-times53.2%
pow253.2%
Applied egg-rr53.2%
count-253.2%
Simplified53.2%
unpow253.2%
Applied egg-rr53.2%
if 2.4000000000000002e-28 < w < 3.69999999999999983e64Initial program 47.9%
times-frac43.1%
fma-def43.1%
associate-/r*43.1%
difference-of-squares43.1%
Simplified47.9%
Taylor expanded in c0 around inf 48.3%
*-commutative48.3%
*-commutative48.3%
times-frac48.3%
unpow248.3%
unpow248.3%
Simplified48.3%
fma-udef48.3%
associate-*r/48.3%
associate-*l/48.3%
pow248.3%
frac-times62.9%
pow262.9%
Applied egg-rr62.9%
count-262.9%
Simplified62.9%
pow262.9%
frac-times48.3%
frac-times53.0%
associate-*r*52.8%
associate-*r*62.4%
associate-*r*67.2%
Applied egg-rr67.2%
times-frac67.1%
*-commutative67.1%
*-commutative67.1%
*-commutative67.1%
Simplified67.1%
Final simplification54.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (* -0.5 (/ 0.0 w))))
(if (<= w -1.8e+81)
t_1
(if (<= w 1.05e-134)
(* t_0 (* 2.0 (* (* (/ d D) (/ d D)) (/ c0 (* w h)))))
(if (or (<= w 5.4e-37) (not (<= w 1.5e+66)))
t_1
(* t_0 (* 2.0 (/ (* d (* c0 d)) (* w (* D (* h D)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = -0.5 * (0.0 / w);
double tmp;
if (w <= -1.8e+81) {
tmp = t_1;
} else if (w <= 1.05e-134) {
tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
} else if ((w <= 5.4e-37) || !(w <= 1.5e+66)) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((d * (c0 * d)) / (w * (D * (h * D)))));
}
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 / (2.0d0 * w)
t_1 = (-0.5d0) * (0.0d0 / w)
if (w <= (-1.8d+81)) then
tmp = t_1
else if (w <= 1.05d-134) then
tmp = t_0 * (2.0d0 * (((d_1 / d) * (d_1 / d)) * (c0 / (w * h))))
else if ((w <= 5.4d-37) .or. (.not. (w <= 1.5d+66))) then
tmp = t_1
else
tmp = t_0 * (2.0d0 * ((d_1 * (c0 * d_1)) / (w * (d * (h * d)))))
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 / (2.0 * w);
double t_1 = -0.5 * (0.0 / w);
double tmp;
if (w <= -1.8e+81) {
tmp = t_1;
} else if (w <= 1.05e-134) {
tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h))));
} else if ((w <= 5.4e-37) || !(w <= 1.5e+66)) {
tmp = t_1;
} else {
tmp = t_0 * (2.0 * ((d * (c0 * d)) / (w * (D * (h * D)))));
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = -0.5 * (0.0 / w) tmp = 0 if w <= -1.8e+81: tmp = t_1 elif w <= 1.05e-134: tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))) elif (w <= 5.4e-37) or not (w <= 1.5e+66): tmp = t_1 else: tmp = t_0 * (2.0 * ((d * (c0 * d)) / (w * (D * (h * D))))) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(-0.5 * Float64(0.0 / w)) tmp = 0.0 if (w <= -1.8e+81) tmp = t_1; elseif (w <= 1.05e-134) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(c0 / Float64(w * h))))); elseif ((w <= 5.4e-37) || !(w <= 1.5e+66)) tmp = t_1; else tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * Float64(c0 * d)) / Float64(w * Float64(D * Float64(h * D)))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = -0.5 * (0.0 / w); tmp = 0.0; if (w <= -1.8e+81) tmp = t_1; elseif (w <= 1.05e-134) tmp = t_0 * (2.0 * (((d / D) * (d / D)) * (c0 / (w * h)))); elseif ((w <= 5.4e-37) || ~((w <= 1.5e+66))) tmp = t_1; else tmp = t_0 * (2.0 * ((d * (c0 * d)) / (w * (D * (h * D))))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -1.8e+81], t$95$1, If[LessEqual[w, 1.05e-134], N[(t$95$0 * N[(2.0 * N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, 5.4e-37], N[Not[LessEqual[w, 1.5e+66]], $MachinePrecision]], t$95$1, N[(t$95$0 * N[(2.0 * N[(N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision] / N[(w * N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := -0.5 \cdot \frac{0}{w}\\
\mathbf{if}\;w \leq -1.8 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0}{w \cdot h}\right)\right)\\
\mathbf{elif}\;w \leq 5.4 \cdot 10^{-37} \lor \neg \left(w \leq 1.5 \cdot 10^{+66}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \left(c0 \cdot d\right)}{w \cdot \left(D \cdot \left(h \cdot D\right)\right)}\right)\\
\end{array}
\end{array}
if w < -1.80000000000000003e81 or 1.05e-134 < w < 5.40000000000000032e-37 or 1.50000000000000001e66 < w Initial program 14.2%
associate-*l*10.9%
difference-of-squares12.1%
associate-*l*12.0%
associate-*l*14.4%
Simplified14.4%
Taylor expanded in c0 around -inf 7.3%
*-commutative7.3%
unpow27.3%
distribute-rgt1-in7.3%
metadata-eval7.3%
mul0-lft43.5%
Simplified43.5%
Taylor expanded in c0 around 0 53.1%
if -1.80000000000000003e81 < w < 1.05e-134Initial program 37.1%
times-frac34.3%
fma-def33.7%
associate-/r*33.7%
difference-of-squares40.7%
Simplified43.6%
Taylor expanded in c0 around inf 42.7%
*-commutative42.7%
*-commutative42.7%
times-frac44.9%
unpow244.9%
unpow244.9%
Simplified44.9%
fma-udef44.9%
associate-*r/45.1%
associate-*l/45.1%
pow245.1%
frac-times53.2%
pow253.2%
Applied egg-rr53.2%
count-253.2%
Simplified53.2%
unpow253.2%
Applied egg-rr53.2%
if 5.40000000000000032e-37 < w < 1.50000000000000001e66Initial program 47.9%
times-frac43.1%
fma-def43.1%
associate-/r*43.1%
difference-of-squares43.1%
Simplified47.9%
Taylor expanded in c0 around inf 48.3%
*-commutative48.3%
*-commutative48.3%
times-frac48.3%
unpow248.3%
unpow248.3%
Simplified48.3%
fma-udef48.3%
associate-*r/48.3%
associate-*l/48.3%
pow248.3%
frac-times62.9%
pow262.9%
Applied egg-rr62.9%
count-262.9%
Simplified62.9%
pow262.9%
frac-times48.3%
frac-times53.0%
associate-*r*52.8%
associate-*r*62.4%
associate-*r*67.2%
Applied egg-rr67.2%
Final simplification54.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (* -0.5 (/ 0.0 w))))
(if (<= w -5.2e+74)
t_1
(if (<= w 5e-266)
(* t_0 (* 2.0 (/ (* (/ d (/ D d)) (/ c0 D)) (* w h))))
(if (<= w 2.8e+63)
(* t_0 (* 2.0 (* (/ (* c0 d) w) (/ d (* D (* h D))))))
t_1)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = -0.5 * (0.0 / w);
double tmp;
if (w <= -5.2e+74) {
tmp = t_1;
} else if (w <= 5e-266) {
tmp = t_0 * (2.0 * (((d / (D / d)) * (c0 / D)) / (w * h)));
} else if (w <= 2.8e+63) {
tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D)))));
} else {
tmp = t_1;
}
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 / (2.0d0 * w)
t_1 = (-0.5d0) * (0.0d0 / w)
if (w <= (-5.2d+74)) then
tmp = t_1
else if (w <= 5d-266) then
tmp = t_0 * (2.0d0 * (((d_1 / (d / d_1)) * (c0 / d)) / (w * h)))
else if (w <= 2.8d+63) then
tmp = t_0 * (2.0d0 * (((c0 * d_1) / w) * (d_1 / (d * (h * d)))))
else
tmp = t_1
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 / (2.0 * w);
double t_1 = -0.5 * (0.0 / w);
double tmp;
if (w <= -5.2e+74) {
tmp = t_1;
} else if (w <= 5e-266) {
tmp = t_0 * (2.0 * (((d / (D / d)) * (c0 / D)) / (w * h)));
} else if (w <= 2.8e+63) {
tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = c0 / (2.0 * w) t_1 = -0.5 * (0.0 / w) tmp = 0 if w <= -5.2e+74: tmp = t_1 elif w <= 5e-266: tmp = t_0 * (2.0 * (((d / (D / d)) * (c0 / D)) / (w * h))) elif w <= 2.8e+63: tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D))))) else: tmp = t_1 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(-0.5 * Float64(0.0 / w)) tmp = 0.0 if (w <= -5.2e+74) tmp = t_1; elseif (w <= 5e-266) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(d / Float64(D / d)) * Float64(c0 / D)) / Float64(w * h)))); elseif (w <= 2.8e+63) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 * d) / w) * Float64(d / Float64(D * Float64(h * D)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = c0 / (2.0 * w); t_1 = -0.5 * (0.0 / w); tmp = 0.0; if (w <= -5.2e+74) tmp = t_1; elseif (w <= 5e-266) tmp = t_0 * (2.0 * (((d / (D / d)) * (c0 / D)) / (w * h))); elseif (w <= 2.8e+63) tmp = t_0 * (2.0 * (((c0 * d) / w) * (d / (D * (h * D))))); else tmp = t_1; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -5.2e+74], t$95$1, If[LessEqual[w, 5e-266], N[(t$95$0 * N[(2.0 * N[(N[(N[(d / N[(D / d), $MachinePrecision]), $MachinePrecision] * N[(c0 / D), $MachinePrecision]), $MachinePrecision] / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.8e+63], N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 * d), $MachinePrecision] / w), $MachinePrecision] * N[(d / N[(D * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := -0.5 \cdot \frac{0}{w}\\
\mathbf{if}\;w \leq -5.2 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq 5 \cdot 10^{-266}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{\frac{d}{\frac{D}{d}} \cdot \frac{c0}{D}}{w \cdot h}\right)\\
\mathbf{elif}\;w \leq 2.8 \cdot 10^{+63}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \left(\frac{c0 \cdot d}{w} \cdot \frac{d}{D \cdot \left(h \cdot D\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if w < -5.2000000000000001e74 or 2.79999999999999987e63 < w Initial program 11.2%
associate-*l*6.9%
difference-of-squares8.5%
associate-*l*8.3%
associate-*l*10.0%
Simplified10.0%
Taylor expanded in c0 around -inf 8.1%
*-commutative8.1%
unpow28.1%
distribute-rgt1-in8.1%
metadata-eval8.1%
mul0-lft44.5%
Simplified44.5%
Taylor expanded in c0 around 0 55.2%
if -5.2000000000000001e74 < w < 4.99999999999999992e-266Initial program 38.3%
times-frac35.5%
fma-def34.6%
times-frac34.8%
difference-of-squares41.4%
Simplified43.0%
*-un-lft-identity43.0%
associate-*l*41.2%
div-inv41.2%
clear-num41.2%
associate-*r/40.2%
*-commutative40.2%
times-frac42.2%
associate-/l/44.1%
fma-neg44.1%
associate-/l/42.2%
frac-times47.8%
pow247.8%
Applied egg-rr47.8%
*-lft-identity47.8%
*-commutative47.8%
fma-udef47.8%
unsub-neg47.8%
associate-/r*47.8%
*-commutative47.8%
Simplified47.8%
Taylor expanded in c0 around inf 47.3%
associate-/r*48.3%
unpow248.3%
unpow248.3%
Simplified48.3%
times-frac53.0%
Applied egg-rr53.0%
associate-/l*57.6%
Simplified57.6%
if 4.99999999999999992e-266 < w < 2.79999999999999987e63Initial program 34.8%
times-frac31.1%
fma-def31.2%
associate-/r*31.2%
difference-of-squares35.0%
Simplified37.6%
Taylor expanded in c0 around inf 37.3%
*-commutative37.3%
*-commutative37.3%
times-frac37.3%
unpow237.3%
unpow237.3%
Simplified37.3%
fma-udef37.3%
associate-*r/37.3%
associate-*l/37.3%
pow237.3%
frac-times45.0%
pow245.0%
Applied egg-rr45.0%
count-245.0%
Simplified45.0%
pow245.0%
frac-times37.1%
frac-times39.6%
associate-*r*40.7%
associate-*r*45.9%
associate-*r*48.4%
Applied egg-rr48.4%
times-frac49.7%
*-commutative49.7%
*-commutative49.7%
*-commutative49.7%
Simplified49.7%
Final simplification54.5%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= w -7.2e+78) (not (<= w 2.3e+62))) (* -0.5 (/ 0.0 w)) (* (/ c0 (* 2.0 w)) (* (/ (/ c0 w) h) (* 2.0 (* (/ d D) (/ d D)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -7.2e+78) || !(w <= 2.3e+62)) {
tmp = -0.5 * (0.0 / w);
} else {
tmp = (c0 / (2.0 * w)) * (((c0 / w) / h) * (2.0 * ((d / D) * (d / D))));
}
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) :: tmp
if ((w <= (-7.2d+78)) .or. (.not. (w <= 2.3d+62))) then
tmp = (-0.5d0) * (0.0d0 / w)
else
tmp = (c0 / (2.0d0 * w)) * (((c0 / w) / h) * (2.0d0 * ((d_1 / d) * (d_1 / d))))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -7.2e+78) || !(w <= 2.3e+62)) {
tmp = -0.5 * (0.0 / w);
} else {
tmp = (c0 / (2.0 * w)) * (((c0 / w) / h) * (2.0 * ((d / D) * (d / D))));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (w <= -7.2e+78) or not (w <= 2.3e+62): tmp = -0.5 * (0.0 / w) else: tmp = (c0 / (2.0 * w)) * (((c0 / w) / h) * (2.0 * ((d / D) * (d / D)))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((w <= -7.2e+78) || !(w <= 2.3e+62)) tmp = Float64(-0.5 * Float64(0.0 / w)); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 / w) / h) * Float64(2.0 * Float64(Float64(d / D) * Float64(d / D))))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((w <= -7.2e+78) || ~((w <= 2.3e+62))) tmp = -0.5 * (0.0 / w); else tmp = (c0 / (2.0 * w)) * (((c0 / w) / h) * (2.0 * ((d / D) * (d / D)))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[w, -7.2e+78], N[Not[LessEqual[w, 2.3e+62]], $MachinePrecision]], N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision] * N[(2.0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -7.2 \cdot 10^{+78} \lor \neg \left(w \leq 2.3 \cdot 10^{+62}\right):\\
\;\;\;\;-0.5 \cdot \frac{0}{w}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{c0}{w}}{h} \cdot \left(2 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\
\end{array}
\end{array}
if w < -7.20000000000000039e78 or 2.29999999999999984e62 < w Initial program 11.2%
associate-*l*6.9%
difference-of-squares8.5%
associate-*l*8.3%
associate-*l*10.0%
Simplified10.0%
Taylor expanded in c0 around -inf 8.1%
*-commutative8.1%
unpow28.1%
distribute-rgt1-in8.1%
metadata-eval8.1%
mul0-lft44.5%
Simplified44.5%
Taylor expanded in c0 around 0 55.2%
if -7.20000000000000039e78 < w < 2.29999999999999984e62Initial program 36.8%
times-frac33.7%
fma-def33.2%
associate-/r*33.2%
difference-of-squares38.6%
Simplified41.9%
Taylor expanded in c0 around inf 40.9%
*-commutative40.9%
*-commutative40.9%
times-frac42.6%
unpow242.6%
unpow242.6%
Simplified42.6%
fma-udef42.6%
associate-*r/42.8%
associate-*l/42.8%
pow242.8%
frac-times51.1%
pow251.1%
Applied egg-rr51.1%
count-251.1%
Simplified51.1%
expm1-log1p-u28.4%
expm1-udef28.1%
rem-cbrt-cube27.5%
*-commutative27.5%
rem-cbrt-cube28.1%
Applied egg-rr28.1%
expm1-def28.4%
expm1-log1p51.1%
*-commutative51.1%
*-commutative51.1%
associate-*l*51.1%
associate-/r*52.7%
Simplified52.7%
unpow251.1%
Applied egg-rr52.7%
Final simplification53.4%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= c0 -1.26e-8) (not (<= c0 2.35e-153))) (* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w)))) (* -0.5 (/ (* 0.0 (* c0 c0)) w))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -1.26e-8) || !(c0 <= 2.35e-153)) {
tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
} else {
tmp = -0.5 * ((0.0 * (c0 * c0)) / 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) :: tmp
if ((c0 <= (-1.26d-8)) .or. (.not. (c0 <= 2.35d-153))) then
tmp = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (h * (w * w)))
else
tmp = (-0.5d0) * ((0.0d0 * (c0 * c0)) / w)
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((c0 <= -1.26e-8) || !(c0 <= 2.35e-153)) {
tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
} else {
tmp = -0.5 * ((0.0 * (c0 * c0)) / w);
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (c0 <= -1.26e-8) or not (c0 <= 2.35e-153): tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))) else: tmp = -0.5 * ((0.0 * (c0 * c0)) / w) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((c0 <= -1.26e-8) || !(c0 <= 2.35e-153)) tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))); else tmp = Float64(-0.5 * Float64(Float64(0.0 * Float64(c0 * c0)) / w)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((c0 <= -1.26e-8) || ~((c0 <= 2.35e-153))) tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))); else tmp = -0.5 * ((0.0 * (c0 * c0)) / w); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[c0, -1.26e-8], N[Not[LessEqual[c0, 2.35e-153]], $MachinePrecision]], N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -1.26 \cdot 10^{-8} \lor \neg \left(c0 \leq 2.35 \cdot 10^{-153}\right):\\
\;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\\
\end{array}
\end{array}
if c0 < -1.26e-8 or 2.35e-153 < c0 Initial program 31.9%
times-frac30.2%
fma-def29.1%
associate-/r*29.2%
difference-of-squares34.3%
Simplified38.8%
Taylor expanded in c0 around inf 36.5%
*-commutative36.5%
*-commutative36.5%
times-frac38.2%
unpow238.2%
unpow238.2%
Simplified38.2%
fma-udef38.2%
associate-*r/38.4%
associate-*l/38.4%
pow238.4%
frac-times49.1%
pow249.1%
Applied egg-rr49.1%
count-249.1%
Simplified49.1%
Taylor expanded in c0 around 0 36.6%
times-frac35.0%
unpow235.0%
unpow235.0%
unpow235.0%
unpow235.0%
Simplified35.0%
frac-times44.1%
Applied egg-rr44.1%
if -1.26e-8 < c0 < 2.35e-153Initial program 25.0%
associate-*l*23.7%
difference-of-squares26.4%
associate-*l*26.4%
associate-*l*26.4%
Simplified26.4%
Taylor expanded in c0 around -inf 8.7%
*-commutative8.7%
unpow28.7%
distribute-rgt1-in8.7%
metadata-eval8.7%
mul0-lft44.6%
Simplified44.6%
Final simplification44.2%
(FPCore (c0 w h D d M) :precision binary64 (* -0.5 (/ 0.0 w)))
double code(double c0, double w, double h, double D, double d, double M) {
return -0.5 * (0.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 = (-0.5d0) * (0.0d0 / w)
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return -0.5 * (0.0 / w);
}
def code(c0, w, h, D, d, M): return -0.5 * (0.0 / w)
function code(c0, w, h, D, d, M) return Float64(-0.5 * Float64(0.0 / w)) end
function tmp = code(c0, w, h, D, d, M) tmp = -0.5 * (0.0 / w); end
code[c0_, w_, h_, D_, d_, M_] := N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.5 \cdot \frac{0}{w}
\end{array}
Initial program 29.8%
associate-*l*27.9%
difference-of-squares32.3%
associate-*l*32.2%
associate-*l*33.0%
Simplified33.0%
Taylor expanded in c0 around -inf 5.9%
*-commutative5.9%
unpow25.9%
distribute-rgt1-in5.9%
metadata-eval5.9%
mul0-lft26.5%
Simplified26.5%
Taylor expanded in c0 around 0 34.5%
Final simplification34.5%
herbie shell --seed 2023256
(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))))))