
(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))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(c0, w, h, d, d_1, m)
use fmin_fmax_functions
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}
Herbie found 16 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))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(c0, w, h, d, d_1, m)
use fmin_fmax_functions
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}
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (/ (* (* (/ d D) c0) d) (* h w)) D))
(t_1 (/ (* d c0) (* (* D (* h w)) D))))
(if (<= M_m 126000.0)
(* (/ c0 (+ w w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M_m M_m)))))
(*
(/ c0 (* 2.0 w))
(+
(/ (* d (* (/ d (* (* h w) D)) c0)) D)
(* (sqrt (fma t_1 d M_m)) (sqrt (- (* t_1 d) M_m))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = ((((d / D) * c0) * d) / (h * w)) / D;
double t_1 = (d * c0) / ((D * (h * w)) * D);
double tmp;
if (M_m <= 126000.0) {
tmp = (c0 / (w + w)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))));
} else {
tmp = (c0 / (2.0 * w)) * (((d * ((d / ((h * w) * D)) * c0)) / D) + (sqrt(fma(t_1, d, M_m)) * sqrt(((t_1 * d) - M_m))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(Float64(Float64(Float64(d / D) * c0) * d) / Float64(h * w)) / D) t_1 = Float64(Float64(d * c0) / Float64(Float64(D * Float64(h * w)) * D)) tmp = 0.0 if (M_m <= 126000.0) tmp = Float64(Float64(c0 / Float64(w + w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M_m * M_m))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(d * Float64(Float64(d / Float64(Float64(h * w) * D)) * c0)) / D) + Float64(sqrt(fma(t_1, d, M_m)) * sqrt(Float64(Float64(t_1 * d) - M_m))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(N[(N[(N[(d / D), $MachinePrecision] * c0), $MachinePrecision] * d), $MachinePrecision] / N[(h * w), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]}, Block[{t$95$1 = N[(N[(d * c0), $MachinePrecision] / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 126000.0], N[(N[(c0 / N[(w + w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(d * N[(N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] + N[(N[Sqrt[N[(t$95$1 * d + M$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(t$95$1 * d), $MachinePrecision] - M$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{\frac{\left(\frac{d}{D} \cdot c0\right) \cdot d}{h \cdot w}}{D}\\
t_1 := \frac{d \cdot c0}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D}\\
\mathbf{if}\;M\_m \leq 126000:\\
\;\;\;\;\frac{c0}{w + w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{d \cdot \left(\frac{d}{\left(h \cdot w\right) \cdot D} \cdot c0\right)}{D} + \sqrt{\mathsf{fma}\left(t\_1, d, M\_m\right)} \cdot \sqrt{t\_1 \cdot d - M\_m}\right)\\
\end{array}
\end{array}
if M < 126000Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
frac-timesN/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites32.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
frac-timesN/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites33.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
frac-timesN/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites34.6%
lift-*.f64N/A
count-2-revN/A
lift-+.f6434.6
Applied rewrites34.6%
if 126000 < M Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites35.7%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (* d (* (/ d (* (* h w) D)) c0)) D))
(t_1 (/ (* d c0) (* (* D (* h w)) D))))
(if (<= M_m 1020000000000.0)
(* (/ c0 (+ w w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M_m M_m)))))
(*
(/ c0 (* 2.0 w))
(+ t_0 (* (sqrt (fma t_1 d M_m)) (sqrt (- (* t_1 d) M_m))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (d * ((d / ((h * w) * D)) * c0)) / D;
double t_1 = (d * c0) / ((D * (h * w)) * D);
double tmp;
if (M_m <= 1020000000000.0) {
tmp = (c0 / (w + w)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))));
} else {
tmp = (c0 / (2.0 * w)) * (t_0 + (sqrt(fma(t_1, d, M_m)) * sqrt(((t_1 * d) - M_m))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(d * Float64(Float64(d / Float64(Float64(h * w) * D)) * c0)) / D) t_1 = Float64(Float64(d * c0) / Float64(Float64(D * Float64(h * w)) * D)) tmp = 0.0 if (M_m <= 1020000000000.0) tmp = Float64(Float64(c0 / Float64(w + w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M_m * M_m))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + Float64(sqrt(fma(t_1, d, M_m)) * sqrt(Float64(Float64(t_1 * d) - M_m))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(d * N[(N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]}, Block[{t$95$1 = N[(N[(d * c0), $MachinePrecision] / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1020000000000.0], N[(N[(c0 / N[(w + w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[(N[Sqrt[N[(t$95$1 * d + M$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(t$95$1 * d), $MachinePrecision] - M$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{d \cdot \left(\frac{d}{\left(h \cdot w\right) \cdot D} \cdot c0\right)}{D}\\
t_1 := \frac{d \cdot c0}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D}\\
\mathbf{if}\;M\_m \leq 1020000000000:\\
\;\;\;\;\frac{c0}{w + w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{\mathsf{fma}\left(t\_1, d, M\_m\right)} \cdot \sqrt{t\_1 \cdot d - M\_m}\right)\\
\end{array}
\end{array}
if M < 1.02e12Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
mult-flipN/A
lift-/.f6436.0
Applied rewrites36.0%
if 1.02e12 < M Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites35.7%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (* d (* (/ d (* (* h w) D)) c0)) D))
(t_1 (/ (* d c0) (* (* (* D D) w) h))))
(if (<= M_m 1e+21)
(* (/ c0 (+ w w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M_m M_m)))))
(*
(/ c0 (* 2.0 w))
(+
(* (/ (* d c0) (* D (* h w))) (/ d D))
(* (sqrt (fma t_1 d M_m)) (sqrt (- (* t_1 d) M_m))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (d * ((d / ((h * w) * D)) * c0)) / D;
double t_1 = (d * c0) / (((D * D) * w) * h);
double tmp;
if (M_m <= 1e+21) {
tmp = (c0 / (w + w)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))));
} else {
tmp = (c0 / (2.0 * w)) * ((((d * c0) / (D * (h * w))) * (d / D)) + (sqrt(fma(t_1, d, M_m)) * sqrt(((t_1 * d) - M_m))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(d * Float64(Float64(d / Float64(Float64(h * w) * D)) * c0)) / D) t_1 = Float64(Float64(d * c0) / Float64(Float64(Float64(D * D) * w) * h)) tmp = 0.0 if (M_m <= 1e+21) tmp = Float64(Float64(c0 / Float64(w + w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M_m * M_m))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(Float64(d * c0) / Float64(D * Float64(h * w))) * Float64(d / D)) + Float64(sqrt(fma(t_1, d, M_m)) * sqrt(Float64(Float64(t_1 * d) - M_m))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(d * N[(N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]}, Block[{t$95$1 = N[(N[(d * c0), $MachinePrecision] / N[(N[(N[(D * D), $MachinePrecision] * w), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 1e+21], N[(N[(c0 / N[(w + w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(d * c0), $MachinePrecision] / N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t$95$1 * d + M$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(t$95$1 * d), $MachinePrecision] - M$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{d \cdot \left(\frac{d}{\left(h \cdot w\right) \cdot D} \cdot c0\right)}{D}\\
t_1 := \frac{d \cdot c0}{\left(\left(D \cdot D\right) \cdot w\right) \cdot h}\\
\mathbf{if}\;M\_m \leq 10^{+21}:\\
\;\;\;\;\frac{c0}{w + w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{d \cdot c0}{D \cdot \left(h \cdot w\right)} \cdot \frac{d}{D} + \sqrt{\mathsf{fma}\left(t\_1, d, M\_m\right)} \cdot \sqrt{t\_1 \cdot d - M\_m}\right)\\
\end{array}
\end{array}
if M < 1e21Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
mult-flipN/A
lift-/.f6436.0
Applied rewrites36.0%
if 1e21 < M Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
Applied rewrites32.6%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (* d (* (/ d (* (* h w) D)) c0)) D)))
(if (<= M_m 4.5e+79)
(* (/ c0 (+ w w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M_m M_m)))))
(*
(/ c0 (* 2.0 w))
(+
t_0
(sqrt
(fma
(- M_m)
M_m
(pow (* (/ (* d c0) (* (* D (* h w)) D)) d) 2.0))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (d * ((d / ((h * w) * D)) * c0)) / D;
double tmp;
if (M_m <= 4.5e+79) {
tmp = (c0 / (w + w)) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))));
} else {
tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(fma(-M_m, M_m, pow((((d * c0) / ((D * (h * w)) * D)) * d), 2.0))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(d * Float64(Float64(d / Float64(Float64(h * w) * D)) * c0)) / D) tmp = 0.0 if (M_m <= 4.5e+79) tmp = Float64(Float64(c0 / Float64(w + w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M_m * M_m))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(fma(Float64(-M_m), M_m, (Float64(Float64(Float64(d * c0) / Float64(Float64(D * Float64(h * w)) * D)) * d) ^ 2.0))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(d * N[(N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]}, If[LessEqual[M$95$m, 4.5e+79], N[(N[(c0 / N[(w + w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[((-M$95$m) * M$95$m + N[Power[N[(N[(N[(d * c0), $MachinePrecision] / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{d \cdot \left(\frac{d}{\left(h \cdot w\right) \cdot D} \cdot c0\right)}{D}\\
\mathbf{if}\;M\_m \leq 4.5 \cdot 10^{+79}:\\
\;\;\;\;\frac{c0}{w + w} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(t\_0 + \sqrt{\mathsf{fma}\left(-M\_m, M\_m, {\left(\frac{d \cdot c0}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \cdot d\right)}^{2}\right)}\right)\\
\end{array}
\end{array}
if M < 4.49999999999999994e79Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
count-2-revN/A
lift-+.f64N/A
mult-flipN/A
lift-/.f6436.0
Applied rewrites36.0%
if 4.49999999999999994e79 < M Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.1
lift-*.f64N/A
pow2N/A
lower-pow.f6443.1
Applied rewrites38.0%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (* D (* h w))) (t_1 (* (/ (* d c0) t_0) (/ d D))))
(if (<= M_m 2e+76)
(* (/ c0 (+ w w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m)))))
(*
(/ c0 (* 2.0 w))
(+
(/ (* d (* (/ d (* (* h w) D)) c0)) D)
(sqrt (fma (- M_m) M_m (pow (* (/ (* d c0) (* t_0 D)) d) 2.0))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = D * (h * w);
double t_1 = ((d * c0) / t_0) * (d / D);
double tmp;
if (M_m <= 2e+76) {
tmp = (c0 / (w + w)) * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))));
} else {
tmp = (c0 / (2.0 * w)) * (((d * ((d / ((h * w) * D)) * c0)) / D) + sqrt(fma(-M_m, M_m, pow((((d * c0) / (t_0 * D)) * d), 2.0))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(D * Float64(h * w)) t_1 = Float64(Float64(Float64(d * c0) / t_0) * Float64(d / D)) tmp = 0.0 if (M_m <= 2e+76) tmp = Float64(Float64(c0 / Float64(w + w)) * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(d * Float64(Float64(d / Float64(Float64(h * w) * D)) * c0)) / D) + sqrt(fma(Float64(-M_m), M_m, (Float64(Float64(Float64(d * c0) / Float64(t_0 * D)) * d) ^ 2.0))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(d * c0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 2e+76], N[(N[(c0 / N[(w + w), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(d * N[(N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] + N[Sqrt[N[((-M$95$m) * M$95$m + N[Power[N[(N[(N[(d * c0), $MachinePrecision] / N[(t$95$0 * D), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := D \cdot \left(h \cdot w\right)\\
t_1 := \frac{d \cdot c0}{t\_0} \cdot \frac{d}{D}\\
\mathbf{if}\;M\_m \leq 2 \cdot 10^{+76}:\\
\;\;\;\;\frac{c0}{w + w} \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{d \cdot \left(\frac{d}{\left(h \cdot w\right) \cdot D} \cdot c0\right)}{D} + \sqrt{\mathsf{fma}\left(-M\_m, M\_m, {\left(\frac{d \cdot c0}{t\_0 \cdot D} \cdot d\right)}^{2}\right)}\right)\\
\end{array}
\end{array}
if M < 2.0000000000000001e76Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
count-2-revN/A
lift-+.f6435.0
Applied rewrites35.0%
if 2.0000000000000001e76 < M Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.1
lift-*.f64N/A
pow2N/A
lower-pow.f6443.1
Applied rewrites38.0%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (* D (* h w)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (* (/ (* d c0) (* t_0 D)) d)))
(if (<= M_m 2.5e-239)
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w)))
(if (<= M_m 1.5e+76)
(* t_1 (+ t_2 (sqrt (- (pow t_2 2.0) (* M_m M_m)))))
(*
t_1
(+
(* (/ (* d c0) t_0) (/ d D))
(sqrt
(fma
(- M_m)
M_m
(pow (* (/ (* d c0) (* (* (* D D) w) h)) d) 2.0)))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = D * (h * w);
double t_1 = c0 / (2.0 * w);
double t_2 = ((d * c0) / (t_0 * D)) * d;
double tmp;
if (M_m <= 2.5e-239) {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
} else if (M_m <= 1.5e+76) {
tmp = t_1 * (t_2 + sqrt((pow(t_2, 2.0) - (M_m * M_m))));
} else {
tmp = t_1 * ((((d * c0) / t_0) * (d / D)) + sqrt(fma(-M_m, M_m, pow((((d * c0) / (((D * D) * w) * h)) * d), 2.0))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(D * Float64(h * w)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(Float64(d * c0) / Float64(t_0 * D)) * d) tmp = 0.0 if (M_m <= 2.5e-239) tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); elseif (M_m <= 1.5e+76) tmp = Float64(t_1 * Float64(t_2 + sqrt(Float64((t_2 ^ 2.0) - Float64(M_m * M_m))))); else tmp = Float64(t_1 * Float64(Float64(Float64(Float64(d * c0) / t_0) * Float64(d / D)) + sqrt(fma(Float64(-M_m), M_m, (Float64(Float64(Float64(d * c0) / Float64(Float64(Float64(D * D) * w) * h)) * d) ^ 2.0))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(d * c0), $MachinePrecision] / N[(t$95$0 * D), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]}, If[LessEqual[M$95$m, 2.5e-239], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 1.5e+76], N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[Power[t$95$2, 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[(N[(d * c0), $MachinePrecision] / t$95$0), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[((-M$95$m) * M$95$m + N[Power[N[(N[(N[(d * c0), $MachinePrecision] / N[(N[(N[(D * D), $MachinePrecision] * w), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := D \cdot \left(h \cdot w\right)\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{d \cdot c0}{t\_0 \cdot D} \cdot d\\
\mathbf{if}\;M\_m \leq 2.5 \cdot 10^{-239}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\mathbf{elif}\;M\_m \leq 1.5 \cdot 10^{+76}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 + \sqrt{{t\_2}^{2} - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\frac{d \cdot c0}{t\_0} \cdot \frac{d}{D} + \sqrt{\mathsf{fma}\left(-M\_m, M\_m, {\left(\frac{d \cdot c0}{\left(\left(D \cdot D\right) \cdot w\right) \cdot h} \cdot d\right)}^{2}\right)}\right)\\
\end{array}
\end{array}
if M < 2.5e-239Initial program 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
if 2.5e-239 < M < 1.4999999999999999e76Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites32.2%
if 1.4999999999999999e76 < M Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
Applied rewrites33.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (/ (* d (* (/ d (* (* h w) D)) c0)) D))
(t_2 (* D (* h w))))
(if (<= (* M_m M_m) 5e+152)
(*
t_0
(+
t_1
(sqrt (- (pow (/ (* (* d c0) (/ d t_2)) (fabs D)) 2.0) (* M_m M_m)))))
(*
t_0
(+
t_1
(sqrt (fma (- M_m) M_m (pow (* (/ (* d c0) (* t_2 D)) d) 2.0))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = (d * ((d / ((h * w) * D)) * c0)) / D;
double t_2 = D * (h * w);
double tmp;
if ((M_m * M_m) <= 5e+152) {
tmp = t_0 * (t_1 + sqrt((pow((((d * c0) * (d / t_2)) / fabs(D)), 2.0) - (M_m * M_m))));
} else {
tmp = t_0 * (t_1 + sqrt(fma(-M_m, M_m, pow((((d * c0) / (t_2 * D)) * d), 2.0))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(d * Float64(Float64(d / Float64(Float64(h * w) * D)) * c0)) / D) t_2 = Float64(D * Float64(h * w)) tmp = 0.0 if (Float64(M_m * M_m) <= 5e+152) tmp = Float64(t_0 * Float64(t_1 + sqrt(Float64((Float64(Float64(Float64(d * c0) * Float64(d / t_2)) / abs(D)) ^ 2.0) - Float64(M_m * M_m))))); else tmp = Float64(t_0 * Float64(t_1 + sqrt(fma(Float64(-M_m), M_m, (Float64(Float64(Float64(d * c0) / Float64(t_2 * D)) * d) ^ 2.0))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(d * N[(N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]}, Block[{t$95$2 = N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(M$95$m * M$95$m), $MachinePrecision], 5e+152], N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[Power[N[(N[(N[(d * c0), $MachinePrecision] * N[(d / t$95$2), $MachinePrecision]), $MachinePrecision] / N[Abs[D], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[((-M$95$m) * M$95$m + N[Power[N[(N[(N[(d * c0), $MachinePrecision] / N[(t$95$2 * D), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{d \cdot \left(\frac{d}{\left(h \cdot w\right) \cdot D} \cdot c0\right)}{D}\\
t_2 := D \cdot \left(h \cdot w\right)\\
\mathbf{if}\;M\_m \cdot M\_m \leq 5 \cdot 10^{+152}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 + \sqrt{{\left(\frac{\left(d \cdot c0\right) \cdot \frac{d}{t\_2}}{\left|D\right|}\right)}^{2} - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 + \sqrt{\mathsf{fma}\left(-M\_m, M\_m, {\left(\frac{d \cdot c0}{t\_2 \cdot D} \cdot d\right)}^{2}\right)}\right)\\
\end{array}
\end{array}
if (*.f64 M M) < 5e152Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-abs-revN/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
Applied rewrites34.3%
if 5e152 < (*.f64 M M) Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.1
lift-*.f64N/A
pow2N/A
lower-pow.f6443.1
Applied rewrites38.0%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (* (/ (* d c0) (* (* D (* h w)) D)) d)))
(if (<= M_m 2.5e-239)
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w)))
(if (<= M_m 1.5e+76)
(* t_0 (+ t_1 (sqrt (- (pow t_1 2.0) (* M_m M_m)))))
(*
t_0
(+
(/ (* c0 (* d d)) (* (* w h) (* D D)))
(sqrt
(fma
(- M_m)
M_m
(pow (* (/ (* d d) (* (* (* D D) w) h)) c0) 2.0)))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = ((d * c0) / ((D * (h * w)) * D)) * d;
double tmp;
if (M_m <= 2.5e-239) {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
} else if (M_m <= 1.5e+76) {
tmp = t_0 * (t_1 + sqrt((pow(t_1, 2.0) - (M_m * M_m))));
} else {
tmp = t_0 * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(fma(-M_m, M_m, pow((((d * d) / (((D * D) * w) * h)) * c0), 2.0))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(Float64(d * c0) / Float64(Float64(D * Float64(h * w)) * D)) * d) tmp = 0.0 if (M_m <= 2.5e-239) tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); elseif (M_m <= 1.5e+76) tmp = Float64(t_0 * Float64(t_1 + sqrt(Float64((t_1 ^ 2.0) - Float64(M_m * M_m))))); else tmp = Float64(t_0 * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(fma(Float64(-M_m), M_m, (Float64(Float64(Float64(d * d) / Float64(Float64(Float64(D * D) * w) * h)) * c0) ^ 2.0))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(d * c0), $MachinePrecision] / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision]}, If[LessEqual[M$95$m, 2.5e-239], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 1.5e+76], N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[Power[t$95$1, 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[((-M$95$m) * M$95$m + N[Power[N[(N[(N[(d * d), $MachinePrecision] / N[(N[(N[(D * D), $MachinePrecision] * w), $MachinePrecision] * h), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{d \cdot c0}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \cdot d\\
\mathbf{if}\;M\_m \leq 2.5 \cdot 10^{-239}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\mathbf{elif}\;M\_m \leq 1.5 \cdot 10^{+76}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 + \sqrt{{t\_1}^{2} - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\mathsf{fma}\left(-M\_m, M\_m, {\left(\frac{d \cdot d}{\left(\left(D \cdot D\right) \cdot w\right) \cdot h} \cdot c0\right)}^{2}\right)}\right)\\
\end{array}
\end{array}
if M < 2.5e-239Initial program 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
if 2.5e-239 < M < 1.4999999999999999e76Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites32.2%
if 1.4999999999999999e76 < M Initial program 24.3%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6430.5
lift-*.f64N/A
pow2N/A
lower-pow.f6430.5
Applied rewrites29.2%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(if (<= M_m 2.5e-239)
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w)))
(*
(/ c0 (* 2.0 w))
(+
(/ (* d (* (/ d (* (* h w) D)) c0)) D)
(sqrt
(fma (- M_m) M_m (pow (* (/ (* d c0) (* (* D (* h w)) D)) d) 2.0)))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 2.5e-239) {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
} else {
tmp = (c0 / (2.0 * w)) * (((d * ((d / ((h * w) * D)) * c0)) / D) + sqrt(fma(-M_m, M_m, pow((((d * c0) / ((D * (h * w)) * D)) * d), 2.0))));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (M_m <= 2.5e-239) tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); else tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(d * Float64(Float64(d / Float64(Float64(h * w) * D)) * c0)) / D) + sqrt(fma(Float64(-M_m), M_m, (Float64(Float64(Float64(d * c0) / Float64(Float64(D * Float64(h * w)) * D)) * d) ^ 2.0))))); end return tmp end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 2.5e-239], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(d * N[(N[(d / N[(N[(h * w), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] + N[Sqrt[N[((-M$95$m) * M$95$m + N[Power[N[(N[(N[(d * c0), $MachinePrecision] / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 2.5 \cdot 10^{-239}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(\frac{d \cdot \left(\frac{d}{\left(h \cdot w\right) \cdot D} \cdot c0\right)}{D} + \sqrt{\mathsf{fma}\left(-M\_m, M\_m, {\left(\frac{d \cdot c0}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \cdot d\right)}^{2}\right)}\right)\\
\end{array}
\end{array}
if M < 2.5e-239Initial program 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
if 2.5e-239 < M Initial program 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.1
lift-*.f64N/A
pow2N/A
lower-pow.f6443.1
Applied rewrites38.0%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (* (/ (* d c0) (* (* D (* h w)) D)) d))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M_m M_m))))) INFINITY)
(* t_1 (+ t_0 (sqrt (- (pow t_0 2.0) (* M_m M_m)))))
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = ((d * c0) / ((D * (h * w)) * D)) * d;
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M_m * M_m))))) <= ((double) INFINITY)) {
tmp = t_1 * (t_0 + sqrt((pow(t_0, 2.0) - (M_m * M_m))));
} else {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = ((d * c0) / ((D * (h * w)) * D)) * d;
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + Math.sqrt(((t_2 * t_2) - (M_m * M_m))))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 * (t_0 + Math.sqrt((Math.pow(t_0, 2.0) - (M_m * M_m))));
} else {
tmp = c0 * (0.5 * (Math.sqrt(-Math.pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = ((d * c0) / ((D * (h * w)) * D)) * d t_1 = c0 / (2.0 * w) t_2 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if (t_1 * (t_2 + math.sqrt(((t_2 * t_2) - (M_m * M_m))))) <= math.inf: tmp = t_1 * (t_0 + math.sqrt((math.pow(t_0, 2.0) - (M_m * M_m)))) else: tmp = c0 * (0.5 * (math.sqrt(-math.pow(M_m, 2.0)) / w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(Float64(d * c0) / Float64(Float64(D * Float64(h * w)) * D)) * d) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M_m * M_m))))) <= Inf) tmp = Float64(t_1 * Float64(t_0 + sqrt(Float64((t_0 ^ 2.0) - Float64(M_m * M_m))))); else tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = ((d * c0) / ((D * (h * w)) * D)) * d; t_1 = c0 / (2.0 * w); t_2 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M_m * M_m))))) <= Inf) tmp = t_1 * (t_0 + sqrt(((t_0 ^ 2.0) - (M_m * M_m)))); else tmp = c0 * (0.5 * (sqrt(-(M_m ^ 2.0)) / w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(N[(d * c0), $MachinePrecision] / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * d), $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] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(t$95$0 + N[Sqrt[N[(N[Power[t$95$0, 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{d \cdot c0}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \cdot d\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_1 \cdot \left(t\_2 + \sqrt{t\_2 \cdot t\_2 - M\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;t\_1 \cdot \left(t\_0 + \sqrt{{t\_0}^{2} - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\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 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites32.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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (* d c0) (* (* D (* h w)) D)))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M_m M_m))))) INFINITY)
(* t_1 (fma t_0 d (sqrt (- (pow (* t_0 d) 2.0) (* M_m M_m)))))
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (d * c0) / ((D * (h * w)) * D);
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_1 * (t_2 + sqrt(((t_2 * t_2) - (M_m * M_m))))) <= ((double) INFINITY)) {
tmp = t_1 * fma(t_0, d, sqrt((pow((t_0 * d), 2.0) - (M_m * M_m))));
} else {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(d * c0) / Float64(Float64(D * Float64(h * w)) * D)) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M_m * M_m))))) <= Inf) tmp = Float64(t_1 * fma(t_0, d, sqrt(Float64((Float64(t_0 * d) ^ 2.0) - Float64(M_m * M_m))))); else tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(d * c0), $MachinePrecision] / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * 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] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[(t$95$0 * d + N[Sqrt[N[(N[Power[N[(t$95$0 * d), $MachinePrecision], 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{d \cdot c0}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_1 \cdot \left(t\_2 + \sqrt{t\_2 \cdot t\_2 - M\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(t\_0, d, \sqrt{{\left(t\_0 \cdot d\right)}^{2} - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\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 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites30.7%
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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (* (* D (* h w)) D)) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m)))))
INFINITY)
(*
(/ c0 (+ w w))
(fma
(* c0 (/ d t_0))
d
(sqrt (- (pow (* (/ (* d c0) t_0) d) 2.0) (* M_m M_m)))))
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (D * (h * w)) * D;
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 * M_m))))) <= ((double) INFINITY)) {
tmp = (c0 / (w + w)) * fma((c0 * (d / t_0)), d, sqrt((pow((((d * c0) / t_0) * d), 2.0) - (M_m * M_m))));
} else {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(D * Float64(h * w)) * D) 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 * M_m))))) <= Inf) tmp = Float64(Float64(c0 / Float64(w + w)) * fma(Float64(c0 * Float64(d / t_0)), d, sqrt(Float64((Float64(Float64(Float64(d * c0) / t_0) * d) ^ 2.0) - Float64(M_m * M_m))))); else tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $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$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(c0 / N[(w + w), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d / t$95$0), $MachinePrecision]), $MachinePrecision] * d + N[Sqrt[N[(N[Power[N[(N[(N[(d * c0), $MachinePrecision] / t$95$0), $MachinePrecision] * d), $MachinePrecision], 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \left(D \cdot \left(h \cdot w\right)\right) \cdot D\\
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\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;\frac{c0}{w + w} \cdot \mathsf{fma}\left(c0 \cdot \frac{d}{t\_0}, d, \sqrt{{\left(\frac{d \cdot c0}{t\_0} \cdot d\right)}^{2} - M\_m \cdot M\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\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 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Applied rewrites30.5%
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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (* (/ d (* (* D (* h w)) D)) d))
(t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m)))))
INFINITY)
(*
c0
(/ (fma t_0 c0 (sqrt (- (pow (* t_0 c0) 2.0) (* M_m M_m)))) (+ w w)))
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (d / ((D * (h * w)) * D)) * d;
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 * M_m))))) <= ((double) INFINITY)) {
tmp = c0 * (fma(t_0, c0, sqrt((pow((t_0 * c0), 2.0) - (M_m * M_m)))) / (w + w));
} else {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(d / Float64(Float64(D * Float64(h * w)) * D)) * d) 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 * M_m))))) <= Inf) tmp = Float64(c0 * Float64(fma(t_0, c0, sqrt(Float64((Float64(t_0 * c0) ^ 2.0) - Float64(M_m * M_m)))) / Float64(w + w))); else tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(d / N[(N[(D * N[(h * w), $MachinePrecision]), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision] * d), $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$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c0 * N[(N[(t$95$0 * c0 + N[Sqrt[N[(N[Power[N[(t$95$0 * c0), $MachinePrecision], 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(w + w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{d}{\left(D \cdot \left(h \cdot w\right)\right) \cdot D} \cdot d\\
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\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;c0 \cdot \frac{\mathsf{fma}\left(t\_0, c0, \sqrt{{\left(t\_0 \cdot c0\right)}^{2} - M\_m \cdot M\_m}\right)}{w + w}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6428.5
Applied rewrites28.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.0
Applied rewrites31.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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (* (/ d (* (* D h) (* D w))) d))
(t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<=
(* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m)))))
INFINITY)
(*
c0
(/ (fma t_0 c0 (sqrt (- (pow (* t_0 c0) 2.0) (* M_m M_m)))) (+ w w)))
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (d / ((D * h) * (D * w))) * d;
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 * M_m))))) <= ((double) INFINITY)) {
tmp = c0 * (fma(t_0, c0, sqrt((pow((t_0 * c0), 2.0) - (M_m * M_m)))) / (w + w));
} else {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(d / Float64(Float64(D * h) * Float64(D * w))) * d) 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 * M_m))))) <= Inf) tmp = Float64(c0 * Float64(fma(t_0, c0, sqrt(Float64((Float64(t_0 * c0) ^ 2.0) - Float64(M_m * M_m)))) / Float64(w + w))); else tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); end return tmp end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(d / N[(N[(D * h), $MachinePrecision] * N[(D * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d), $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$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c0 * N[(N[(t$95$0 * c0 + N[Sqrt[N[(N[Power[N[(t$95$0 * c0), $MachinePrecision], 2.0], $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(w + w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{d}{\left(D \cdot h\right) \cdot \left(D \cdot w\right)} \cdot d\\
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\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;c0 \cdot \frac{\mathsf{fma}\left(t\_0, c0, \sqrt{{\left(t\_0 \cdot c0\right)}^{2} - M\_m \cdot M\_m}\right)}{w + w}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m))))) (- INFINITY))
(*
t_0
(+ (/ (/ (* (* (/ d D) c0) d) (* h w)) D) (sqrt (* -1.0 (pow M_m 2.0)))))
(* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= -((double) INFINITY)) {
tmp = t_0 * ((((((d / D) * c0) * d) / (h * w)) / D) + sqrt((-1.0 * pow(M_m, 2.0))));
} else {
tmp = c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= -Double.POSITIVE_INFINITY) {
tmp = t_0 * ((((((d / D) * c0) * d) / (h * w)) / D) + Math.sqrt((-1.0 * Math.pow(M_m, 2.0))));
} else {
tmp = c0 * (0.5 * (Math.sqrt(-Math.pow(M_m, 2.0)) / w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= -math.inf: tmp = t_0 * ((((((d / D) * c0) * d) / (h * w)) / D) + math.sqrt((-1.0 * math.pow(M_m, 2.0)))) else: tmp = c0 * (0.5 * (math.sqrt(-math.pow(M_m, 2.0)) / w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))) <= Float64(-Inf)) tmp = Float64(t_0 * Float64(Float64(Float64(Float64(Float64(Float64(d / D) * c0) * d) / Float64(h * w)) / D) + sqrt(Float64(-1.0 * (M_m ^ 2.0))))); else tmp = Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= -Inf) tmp = t_0 * ((((((d / D) * c0) * d) / (h * w)) / D) + sqrt((-1.0 * (M_m ^ 2.0)))); else tmp = c0 * (0.5 * (sqrt(-(M_m ^ 2.0)) / w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $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[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(t$95$0 * N[(N[(N[(N[(N[(N[(d / D), $MachinePrecision] * c0), $MachinePrecision] * d), $MachinePrecision] / N[(h * w), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision] + N[Sqrt[N[(-1.0 * N[Power[M$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq -\infty:\\
\;\;\;\;t\_0 \cdot \left(\frac{\frac{\left(\frac{d}{D} \cdot c0\right) \cdot d}{h \cdot w}}{D} + \sqrt{-1 \cdot {M\_m}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)\\
\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 24.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6423.8
Applied rewrites23.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6424.0
Applied rewrites24.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.6
Applied rewrites33.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6433.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6433.9
Applied rewrites33.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l/N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
frac-timesN/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites32.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
frac-timesN/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites33.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
*-commutativeN/A
frac-timesN/A
lift-/.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites34.6%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-pow.f6410.6
Applied rewrites10.6%
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 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (* c0 (* 0.5 (/ (sqrt (- (pow M_m 2.0))) w))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
return c0 * (0.5 * (sqrt(-pow(M_m, 2.0)) / w));
}
M_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(c0, w, h, d, d_1, m_m)
use fmin_fmax_functions
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_m
code = c0 * (0.5d0 * (sqrt(-(m_m ** 2.0d0)) / w))
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
return c0 * (0.5 * (Math.sqrt(-Math.pow(M_m, 2.0)) / w));
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): return c0 * (0.5 * (math.sqrt(-math.pow(M_m, 2.0)) / w))
M_m = abs(M) function code(c0, w, h, D, d, M_m) return Float64(c0 * Float64(0.5 * Float64(sqrt(Float64(-(M_m ^ 2.0))) / w))) end
M_m = abs(M); function tmp = code(c0, w, h, D, d, M_m) tmp = c0 * (0.5 * (sqrt(-(M_m ^ 2.0)) / w)); end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := N[(c0 * N[(0.5 * N[(N[Sqrt[(-N[Power[M$95$m, 2.0], $MachinePrecision])], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
M_m = \left|M\right|
\\
c0 \cdot \left(0.5 \cdot \frac{\sqrt{-{M\_m}^{2}}}{w}\right)
\end{array}
Initial program 24.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6429.1
Applied rewrites29.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6428.7
Applied rewrites28.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.4
Applied rewrites31.4%
Taylor expanded in c0 around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-pow.f6414.9
Applied rewrites14.9%
herbie shell --seed 2025164
(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))))))