
(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 6 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 (* (* w h) (* D D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) t_0)))
(if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
(* t_1 (/ (* 2.0 (* d (* c0 d))) t_0))
(* -0.5 (/ 0.0 w)))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (w * h) * (D * D);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / t_0;
double tmp;
if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_1 * ((2.0 * (d * (c0 * d))) / t_0);
} 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 = (w * h) * (D * D);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / t_0;
double tmp;
if ((t_1 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 * ((2.0 * (d * (c0 * d))) / t_0);
} else {
tmp = -0.5 * (0.0 / w);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (w * h) * (D * D) t_1 = c0 / (2.0 * w) t_2 = (c0 * (d * d)) / t_0 tmp = 0 if (t_1 * (t_2 + math.sqrt(((t_2 * t_2) - (M * M))))) <= math.inf: tmp = t_1 * ((2.0 * (d * (c0 * d))) / t_0) else: tmp = -0.5 * (0.0 / w) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(w * h) * Float64(D * D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / t_0) tmp = 0.0 if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf) tmp = Float64(t_1 * Float64(Float64(2.0 * Float64(d * Float64(c0 * d))) / t_0)); 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 = (w * h) * (D * D); t_1 = c0 / (2.0 * w); t_2 = (c0 * (d * d)) / t_0; tmp = 0.0; if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= Inf) tmp = t_1 * ((2.0 * (d * (c0 * d))) / t_0); 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[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(N[(2.0 * N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(w \cdot h\right) \cdot \left(D \cdot D\right)\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{t_0}\\
\mathbf{if}\;t_1 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_1 \cdot \frac{2 \cdot \left(d \cdot \left(c0 \cdot d\right)\right)}{t_0}\\
\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.8%
times-frac72.4%
fma-def70.3%
associate-/r*70.5%
difference-of-squares70.5%
Simplified72.3%
Taylor expanded in c0 around inf 74.0%
*-commutative74.0%
unpow274.0%
associate-*r/73.0%
unpow273.0%
unpow273.0%
*-commutative73.0%
unpow273.0%
Simplified73.0%
Taylor expanded in c0 around 0 79.2%
associate-*r/79.2%
unpow279.2%
associate-*l*80.8%
unpow280.8%
Simplified80.8%
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.3%
associate-*l*7.3%
associate-*l*7.9%
Simplified7.9%
Taylor expanded in c0 around -inf 0.7%
*-commutative0.7%
unpow20.7%
distribute-rgt1-in0.7%
metadata-eval0.7%
mul0-lft34.9%
Simplified34.9%
Taylor expanded in c0 around 0 43.2%
Final simplification56.4%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* -0.5 (/ 0.0 w)))
(t_1 (* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w))))))
(if (<= c0 -8.2e+196)
t_1
(if (<= c0 -3.55e+90)
t_0
(if (<= c0 -2.2e+39)
t_1
(if (<= c0 -5e-50)
t_0
(if (or (<= c0 -5.2e-120) (not (<= c0 32500000000.0)))
t_1
(* -0.5 (/ (* 0.0 (* c0 c0)) w)))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = -0.5 * (0.0 / w);
double t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
double tmp;
if (c0 <= -8.2e+196) {
tmp = t_1;
} else if (c0 <= -3.55e+90) {
tmp = t_0;
} else if (c0 <= -2.2e+39) {
tmp = t_1;
} else if (c0 <= -5e-50) {
tmp = t_0;
} else if ((c0 <= -5.2e-120) || !(c0 <= 32500000000.0)) {
tmp = t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-0.5d0) * (0.0d0 / w)
t_1 = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (h * (w * w)))
if (c0 <= (-8.2d+196)) then
tmp = t_1
else if (c0 <= (-3.55d+90)) then
tmp = t_0
else if (c0 <= (-2.2d+39)) then
tmp = t_1
else if (c0 <= (-5d-50)) then
tmp = t_0
else if ((c0 <= (-5.2d-120)) .or. (.not. (c0 <= 32500000000.0d0))) then
tmp = t_1
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 t_0 = -0.5 * (0.0 / w);
double t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
double tmp;
if (c0 <= -8.2e+196) {
tmp = t_1;
} else if (c0 <= -3.55e+90) {
tmp = t_0;
} else if (c0 <= -2.2e+39) {
tmp = t_1;
} else if (c0 <= -5e-50) {
tmp = t_0;
} else if ((c0 <= -5.2e-120) || !(c0 <= 32500000000.0)) {
tmp = t_1;
} else {
tmp = -0.5 * ((0.0 * (c0 * c0)) / w);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = -0.5 * (0.0 / w) t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))) tmp = 0 if c0 <= -8.2e+196: tmp = t_1 elif c0 <= -3.55e+90: tmp = t_0 elif c0 <= -2.2e+39: tmp = t_1 elif c0 <= -5e-50: tmp = t_0 elif (c0 <= -5.2e-120) or not (c0 <= 32500000000.0): tmp = t_1 else: tmp = -0.5 * ((0.0 * (c0 * c0)) / w) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(-0.5 * Float64(0.0 / w)) t_1 = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))) tmp = 0.0 if (c0 <= -8.2e+196) tmp = t_1; elseif (c0 <= -3.55e+90) tmp = t_0; elseif (c0 <= -2.2e+39) tmp = t_1; elseif (c0 <= -5e-50) tmp = t_0; elseif ((c0 <= -5.2e-120) || !(c0 <= 32500000000.0)) tmp = t_1; 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) t_0 = -0.5 * (0.0 / w); t_1 = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))); tmp = 0.0; if (c0 <= -8.2e+196) tmp = t_1; elseif (c0 <= -3.55e+90) tmp = t_0; elseif (c0 <= -2.2e+39) tmp = t_1; elseif (c0 <= -5e-50) tmp = t_0; elseif ((c0 <= -5.2e-120) || ~((c0 <= 32500000000.0))) tmp = t_1; else tmp = -0.5 * ((0.0 * (c0 * c0)) / w); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[c0, -8.2e+196], t$95$1, If[LessEqual[c0, -3.55e+90], t$95$0, If[LessEqual[c0, -2.2e+39], t$95$1, If[LessEqual[c0, -5e-50], t$95$0, If[Or[LessEqual[c0, -5.2e-120], N[Not[LessEqual[c0, 32500000000.0]], $MachinePrecision]], t$95$1, N[(-0.5 * N[(N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.5 \cdot \frac{0}{w}\\
t_1 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\mathbf{if}\;c0 \leq -8.2 \cdot 10^{+196}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c0 \leq -3.55 \cdot 10^{+90}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq -2.2 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c0 \leq -5 \cdot 10^{-50}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq -5.2 \cdot 10^{-120} \lor \neg \left(c0 \leq 32500000000\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\\
\end{array}
\end{array}
if c0 < -8.1999999999999993e196 or -3.54999999999999988e90 < c0 < -2.2000000000000001e39 or -4.99999999999999968e-50 < c0 < -5.2000000000000002e-120 or 3.25e10 < c0 Initial program 35.2%
times-frac32.9%
fma-def32.2%
associate-/r*32.2%
difference-of-squares39.1%
Simplified44.7%
fma-udef45.4%
associate-/l/40.8%
frac-times44.7%
pow244.7%
fma-udef44.7%
associate-/l/39.9%
times-frac39.2%
associate-/l/39.1%
times-frac39.1%
Applied egg-rr42.9%
Taylor expanded in c0 around inf 40.0%
times-frac37.1%
unpow237.1%
associate-/r*42.5%
unpow242.5%
associate-*r/49.3%
associate-*l/49.3%
unpow249.3%
unpow249.3%
*-commutative49.3%
unpow249.3%
Simplified49.3%
unpow249.3%
Applied egg-rr49.3%
if -8.1999999999999993e196 < c0 < -3.54999999999999988e90 or -2.2000000000000001e39 < c0 < -4.99999999999999968e-50Initial program 18.8%
associate-*l*14.6%
difference-of-squares16.6%
associate-*l*16.6%
associate-*l*18.6%
Simplified18.6%
Taylor expanded in c0 around -inf 2.2%
*-commutative2.2%
unpow22.2%
distribute-rgt1-in2.2%
metadata-eval2.2%
mul0-lft33.5%
Simplified33.5%
Taylor expanded in c0 around 0 44.4%
if -5.2000000000000002e-120 < c0 < 3.25e10Initial program 19.0%
associate-*l*17.6%
difference-of-squares20.2%
associate-*l*20.3%
associate-*l*20.5%
Simplified20.5%
Taylor expanded in c0 around -inf 7.0%
*-commutative7.0%
unpow27.0%
distribute-rgt1-in7.0%
metadata-eval7.0%
mul0-lft49.7%
Simplified49.7%
Final simplification48.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* h (* w w)))
(t_1 (* -0.5 (/ 0.0 w)))
(t_2 (* (* (/ d D) (/ d D)) (/ (* c0 c0) t_0))))
(if (<= c0 -3.3e+201)
t_2
(if (<= c0 -1.15e+90)
t_1
(if (<= c0 -3.7e+33)
t_2
(if (<= c0 -1.75e-51)
t_1
(if (<= c0 -1.3e-118)
(/ (* (* d d) (* c0 c0)) (* (* D D) t_0))
(if (<= c0 440000000000.0)
(* -0.5 (/ (* 0.0 (* c0 c0)) w))
t_2))))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = h * (w * w);
double t_1 = -0.5 * (0.0 / w);
double t_2 = ((d / D) * (d / D)) * ((c0 * c0) / t_0);
double tmp;
if (c0 <= -3.3e+201) {
tmp = t_2;
} else if (c0 <= -1.15e+90) {
tmp = t_1;
} else if (c0 <= -3.7e+33) {
tmp = t_2;
} else if (c0 <= -1.75e-51) {
tmp = t_1;
} else if (c0 <= -1.3e-118) {
tmp = ((d * d) * (c0 * c0)) / ((D * D) * t_0);
} else if (c0 <= 440000000000.0) {
tmp = -0.5 * ((0.0 * (c0 * c0)) / w);
} else {
tmp = t_2;
}
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) :: tmp
t_0 = h * (w * w)
t_1 = (-0.5d0) * (0.0d0 / w)
t_2 = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / t_0)
if (c0 <= (-3.3d+201)) then
tmp = t_2
else if (c0 <= (-1.15d+90)) then
tmp = t_1
else if (c0 <= (-3.7d+33)) then
tmp = t_2
else if (c0 <= (-1.75d-51)) then
tmp = t_1
else if (c0 <= (-1.3d-118)) then
tmp = ((d_1 * d_1) * (c0 * c0)) / ((d * d) * t_0)
else if (c0 <= 440000000000.0d0) then
tmp = (-0.5d0) * ((0.0d0 * (c0 * c0)) / w)
else
tmp = t_2
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 = h * (w * w);
double t_1 = -0.5 * (0.0 / w);
double t_2 = ((d / D) * (d / D)) * ((c0 * c0) / t_0);
double tmp;
if (c0 <= -3.3e+201) {
tmp = t_2;
} else if (c0 <= -1.15e+90) {
tmp = t_1;
} else if (c0 <= -3.7e+33) {
tmp = t_2;
} else if (c0 <= -1.75e-51) {
tmp = t_1;
} else if (c0 <= -1.3e-118) {
tmp = ((d * d) * (c0 * c0)) / ((D * D) * t_0);
} else if (c0 <= 440000000000.0) {
tmp = -0.5 * ((0.0 * (c0 * c0)) / w);
} else {
tmp = t_2;
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = h * (w * w) t_1 = -0.5 * (0.0 / w) t_2 = ((d / D) * (d / D)) * ((c0 * c0) / t_0) tmp = 0 if c0 <= -3.3e+201: tmp = t_2 elif c0 <= -1.15e+90: tmp = t_1 elif c0 <= -3.7e+33: tmp = t_2 elif c0 <= -1.75e-51: tmp = t_1 elif c0 <= -1.3e-118: tmp = ((d * d) * (c0 * c0)) / ((D * D) * t_0) elif c0 <= 440000000000.0: tmp = -0.5 * ((0.0 * (c0 * c0)) / w) else: tmp = t_2 return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(h * Float64(w * w)) t_1 = Float64(-0.5 * Float64(0.0 / w)) t_2 = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / t_0)) tmp = 0.0 if (c0 <= -3.3e+201) tmp = t_2; elseif (c0 <= -1.15e+90) tmp = t_1; elseif (c0 <= -3.7e+33) tmp = t_2; elseif (c0 <= -1.75e-51) tmp = t_1; elseif (c0 <= -1.3e-118) tmp = Float64(Float64(Float64(d * d) * Float64(c0 * c0)) / Float64(Float64(D * D) * t_0)); elseif (c0 <= 440000000000.0) tmp = Float64(-0.5 * Float64(Float64(0.0 * Float64(c0 * c0)) / w)); else tmp = t_2; end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = h * (w * w); t_1 = -0.5 * (0.0 / w); t_2 = ((d / D) * (d / D)) * ((c0 * c0) / t_0); tmp = 0.0; if (c0 <= -3.3e+201) tmp = t_2; elseif (c0 <= -1.15e+90) tmp = t_1; elseif (c0 <= -3.7e+33) tmp = t_2; elseif (c0 <= -1.75e-51) tmp = t_1; elseif (c0 <= -1.3e-118) tmp = ((d * d) * (c0 * c0)) / ((D * D) * t_0); elseif (c0 <= 440000000000.0) tmp = -0.5 * ((0.0 * (c0 * c0)) / w); else tmp = t_2; end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(h * N[(w * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * c0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -3.3e+201], t$95$2, If[LessEqual[c0, -1.15e+90], t$95$1, If[LessEqual[c0, -3.7e+33], t$95$2, If[LessEqual[c0, -1.75e-51], t$95$1, If[LessEqual[c0, -1.3e-118], N[(N[(N[(d * d), $MachinePrecision] * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(N[(D * D), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 440000000000.0], N[(-0.5 * N[(N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := h \cdot \left(w \cdot w\right)\\
t_1 := -0.5 \cdot \frac{0}{w}\\
t_2 := \left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{t_0}\\
\mathbf{if}\;c0 \leq -3.3 \cdot 10^{+201}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c0 \leq -1.15 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c0 \leq -3.7 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c0 \leq -1.75 \cdot 10^{-51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c0 \leq -1.3 \cdot 10^{-118}:\\
\;\;\;\;\frac{\left(d \cdot d\right) \cdot \left(c0 \cdot c0\right)}{\left(D \cdot D\right) \cdot t_0}\\
\mathbf{elif}\;c0 \leq 440000000000:\\
\;\;\;\;-0.5 \cdot \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c0 < -3.3e201 or -1.15e90 < c0 < -3.6999999999999999e33 or 4.4e11 < c0 Initial program 34.1%
times-frac31.5%
fma-def30.7%
associate-/r*30.7%
difference-of-squares35.9%
Simplified42.0%
fma-udef42.7%
associate-/l/37.7%
frac-times41.9%
pow241.9%
fma-udef41.9%
associate-/l/36.8%
times-frac35.9%
associate-/l/35.9%
times-frac35.9%
Applied egg-rr41.7%
Taylor expanded in c0 around inf 36.8%
times-frac34.4%
unpow234.4%
associate-/r*40.4%
unpow240.4%
associate-*r/47.1%
associate-*l/47.1%
unpow247.1%
unpow247.1%
*-commutative47.1%
unpow247.1%
Simplified47.1%
unpow247.1%
Applied egg-rr47.1%
if -3.3e201 < c0 < -1.15e90 or -3.6999999999999999e33 < c0 < -1.7499999999999999e-51Initial program 18.8%
associate-*l*14.6%
difference-of-squares16.6%
associate-*l*16.6%
associate-*l*18.6%
Simplified18.6%
Taylor expanded in c0 around -inf 2.2%
*-commutative2.2%
unpow22.2%
distribute-rgt1-in2.2%
metadata-eval2.2%
mul0-lft33.5%
Simplified33.5%
Taylor expanded in c0 around 0 44.4%
if -1.7499999999999999e-51 < c0 < -1.3e-118Initial program 45.9%
times-frac45.9%
fma-def46.0%
associate-/r*46.0%
difference-of-squares69.1%
Simplified69.6%
fma-udef69.6%
associate-/l/69.2%
frac-times70.4%
pow270.4%
fma-udef70.4%
associate-/l/69.0%
times-frac69.1%
associate-/l/69.1%
times-frac69.1%
Applied egg-rr53.5%
Taylor expanded in c0 around inf 69.6%
times-frac61.8%
unpow261.8%
unpow261.8%
unpow261.8%
*-commutative61.8%
unpow261.8%
Simplified61.8%
frac-times69.6%
Applied egg-rr69.6%
if -1.3e-118 < c0 < 4.4e11Initial program 19.0%
associate-*l*17.6%
difference-of-squares20.2%
associate-*l*20.3%
associate-*l*20.5%
Simplified20.5%
Taylor expanded in c0 around -inf 7.0%
*-commutative7.0%
unpow27.0%
distribute-rgt1-in7.0%
metadata-eval7.0%
mul0-lft49.7%
Simplified49.7%
Final simplification48.5%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ (/ c0 w) h) (* (/ d D) (/ d D)))))))
(if (<= c0 -5.4e+29)
t_0
(if (<= c0 -3.5e-51)
(* -0.5 (/ 0.0 w))
(if (or (<= c0 -4.5e-128) (not (<= c0 5.5e+31)))
t_0
(* -0.5 (/ (* 0.0 (* c0 c0)) w)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D))));
double tmp;
if (c0 <= -5.4e+29) {
tmp = t_0;
} else if (c0 <= -3.5e-51) {
tmp = -0.5 * (0.0 / w);
} else if ((c0 <= -4.5e-128) || !(c0 <= 5.5e+31)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (c0 / (2.0d0 * w)) * (2.0d0 * (((c0 / w) / h) * ((d_1 / d) * (d_1 / d))))
if (c0 <= (-5.4d+29)) then
tmp = t_0
else if (c0 <= (-3.5d-51)) then
tmp = (-0.5d0) * (0.0d0 / w)
else if ((c0 <= (-4.5d-128)) .or. (.not. (c0 <= 5.5d+31))) then
tmp = t_0
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 t_0 = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D))));
double tmp;
if (c0 <= -5.4e+29) {
tmp = t_0;
} else if (c0 <= -3.5e-51) {
tmp = -0.5 * (0.0 / w);
} else if ((c0 <= -4.5e-128) || !(c0 <= 5.5e+31)) {
tmp = t_0;
} else {
tmp = -0.5 * ((0.0 * (c0 * c0)) / w);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D)))) tmp = 0 if c0 <= -5.4e+29: tmp = t_0 elif c0 <= -3.5e-51: tmp = -0.5 * (0.0 / w) elif (c0 <= -4.5e-128) or not (c0 <= 5.5e+31): tmp = t_0 else: tmp = -0.5 * ((0.0 * (c0 * c0)) / w) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(c0 / w) / h) * Float64(Float64(d / D) * Float64(d / D))))) tmp = 0.0 if (c0 <= -5.4e+29) tmp = t_0; elseif (c0 <= -3.5e-51) tmp = Float64(-0.5 * Float64(0.0 / w)); elseif ((c0 <= -4.5e-128) || !(c0 <= 5.5e+31)) tmp = t_0; 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) t_0 = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D)))); tmp = 0.0; if (c0 <= -5.4e+29) tmp = t_0; elseif (c0 <= -3.5e-51) tmp = -0.5 * (0.0 / w); elseif ((c0 <= -4.5e-128) || ~((c0 <= 5.5e+31))) tmp = t_0; else tmp = -0.5 * ((0.0 * (c0 * c0)) / w); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -5.4e+29], t$95$0, If[LessEqual[c0, -3.5e-51], N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, -4.5e-128], N[Not[LessEqual[c0, 5.5e+31]], $MachinePrecision]], t$95$0, N[(-0.5 * N[(N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{\frac{c0}{w}}{h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\
\mathbf{if}\;c0 \leq -5.4 \cdot 10^{+29}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq -3.5 \cdot 10^{-51}:\\
\;\;\;\;-0.5 \cdot \frac{0}{w}\\
\mathbf{elif}\;c0 \leq -4.5 \cdot 10^{-128} \lor \neg \left(c0 \leq 5.5 \cdot 10^{+31}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\\
\end{array}
\end{array}
if c0 < -5.4e29 or -3.4999999999999997e-51 < c0 < -4.4999999999999999e-128 or 5.50000000000000002e31 < c0 Initial program 32.1%
times-frac29.6%
fma-def29.6%
associate-/r*29.6%
difference-of-squares36.0%
Simplified40.1%
Taylor expanded in c0 around inf 38.2%
*-commutative38.2%
unpow238.2%
associate-*r/37.8%
unpow237.8%
unpow237.8%
*-commutative37.8%
unpow237.8%
Simplified37.8%
Taylor expanded in c0 around 0 40.7%
times-frac38.9%
unpow238.9%
associate-/r*44.1%
unpow244.1%
associate-*l/50.9%
associate-/r/50.9%
*-commutative50.9%
associate-/r*51.2%
associate-/r/51.2%
associate-*r/51.8%
unpow251.8%
Simplified51.8%
unpow244.6%
Applied egg-rr51.8%
if -5.4e29 < c0 < -3.4999999999999997e-51Initial program 17.7%
associate-*l*6.0%
difference-of-squares6.0%
associate-*l*6.0%
associate-*l*6.0%
Simplified6.0%
Taylor expanded in c0 around -inf 5.9%
*-commutative5.9%
unpow25.9%
distribute-rgt1-in5.9%
metadata-eval5.9%
mul0-lft54.4%
Simplified54.4%
Taylor expanded in c0 around 0 54.4%
if -4.4999999999999999e-128 < c0 < 5.50000000000000002e31Initial program 20.1%
associate-*l*18.8%
difference-of-squares21.2%
associate-*l*21.2%
associate-*l*21.5%
Simplified21.5%
Taylor expanded in c0 around -inf 7.8%
*-commutative7.8%
unpow27.8%
distribute-rgt1-in7.8%
metadata-eval7.8%
mul0-lft48.6%
Simplified48.6%
Final simplification51.0%
(FPCore (c0 w h D d M)
:precision binary64
(if (<= (* D D) 1e-107)
(* -0.5 (/ 0.0 w))
(if (<= (* D D) 5e+301)
(* (/ c0 (* 2.0 w)) (* 2.0 (* (/ (* d d) (* D D)) (/ c0 (* w h)))))
(* (* (/ d D) (/ d D)) (/ (* c0 c0) (* h (* w w)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((D * D) <= 1e-107) {
tmp = -0.5 * (0.0 / w);
} else if ((D * D) <= 5e+301) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h))));
} else {
tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * 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 ((d * d) <= 1d-107) then
tmp = (-0.5d0) * (0.0d0 / w)
else if ((d * d) <= 5d+301) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((d_1 * d_1) / (d * d)) * (c0 / (w * h))))
else
tmp = ((d_1 / d) * (d_1 / d)) * ((c0 * c0) / (h * (w * 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 ((D * D) <= 1e-107) {
tmp = -0.5 * (0.0 / w);
} else if ((D * D) <= 5e+301) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h))));
} else {
tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (D * D) <= 1e-107: tmp = -0.5 * (0.0 / w) elif (D * D) <= 5e+301: tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h)))) else: tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if (Float64(D * D) <= 1e-107) tmp = Float64(-0.5 * Float64(0.0 / w)); elseif (Float64(D * D) <= 5e+301) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(d * d) / Float64(D * D)) * Float64(c0 / Float64(w * h))))); else tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 * c0) / Float64(h * Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((D * D) <= 1e-107) tmp = -0.5 * (0.0 / w); elseif ((D * D) <= 5e+301) tmp = (c0 / (2.0 * w)) * (2.0 * (((d * d) / (D * D)) * (c0 / (w * h)))); else tmp = ((d / D) * (d / D)) * ((c0 * c0) / (h * (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[LessEqual[N[(D * D), $MachinePrecision], 1e-107], N[(-0.5 * N[(0.0 / w), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(D * D), $MachinePrecision], 5e+301], 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], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;D \cdot D \leq 10^{-107}:\\
\;\;\;\;-0.5 \cdot \frac{0}{w}\\
\mathbf{elif}\;D \cdot D \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{c0}{w \cdot h}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}\\
\end{array}
\end{array}
if (*.f64 D D) < 1e-107Initial program 24.0%
associate-*l*23.3%
difference-of-squares29.5%
associate-*l*29.5%
associate-*l*30.3%
Simplified30.3%
Taylor expanded in c0 around -inf 4.2%
*-commutative4.2%
unpow24.2%
distribute-rgt1-in4.2%
metadata-eval4.2%
mul0-lft34.4%
Simplified34.4%
Taylor expanded in c0 around 0 39.5%
if 1e-107 < (*.f64 D D) < 5.0000000000000004e301Initial program 41.7%
times-frac37.1%
fma-def37.2%
times-frac37.2%
difference-of-squares40.8%
Simplified40.8%
sqrt-prod42.0%
associate-*l*40.8%
div-inv40.8%
clear-num40.8%
associate-*r/40.8%
*-commutative40.8%
times-frac42.3%
associate-/l/42.3%
fma-neg42.3%
associate-/l/42.3%
frac-times42.2%
pow242.2%
Applied egg-rr42.2%
Taylor expanded in c0 around inf 47.9%
times-frac46.7%
unpow246.7%
unpow246.7%
Simplified46.7%
if 5.0000000000000004e301 < (*.f64 D D) Initial program 0.2%
times-frac0.2%
fma-def0.2%
associate-/r*0.7%
difference-of-squares0.7%
Simplified28.3%
fma-udef28.2%
associate-/l/1.5%
frac-times28.4%
pow228.4%
fma-udef28.4%
associate-/l/0.1%
times-frac0.3%
associate-/l/0.7%
times-frac0.7%
Applied egg-rr39.5%
Taylor expanded in c0 around inf 0.2%
times-frac0.4%
unpow20.4%
associate-/r*32.7%
unpow232.7%
associate-*r/43.8%
associate-*l/48.1%
unpow248.1%
unpow248.1%
*-commutative48.1%
unpow248.1%
Simplified48.1%
unpow248.1%
Applied egg-rr48.1%
Final simplification42.7%
(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 27.3%
associate-*l*26.1%
difference-of-squares30.8%
associate-*l*30.8%
associate-*l*31.3%
Simplified31.3%
Taylor expanded in c0 around -inf 3.8%
*-commutative3.8%
unpow23.8%
distribute-rgt1-in3.8%
metadata-eval3.8%
mul0-lft26.2%
Simplified26.2%
Taylor expanded in c0 around 0 32.2%
Final simplification32.2%
herbie shell --seed 2023178
(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))))))