
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
public static double code(double d, double h, double l, double M, double D) {
return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
def code(d, h, l, M, D): return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
function code(d, h, l, M, D) return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) end
function tmp = code(d, h, l, M, D) tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (fmax (fabs M) (fabs D)))
(t_1 (fmin (fabs M) (fabs D)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* t_1 t_0) (* 2.0 d)) 2.0)) (/ h l)))))
(t_3 (/ t_1 (* (* d d) l)))
(t_4 (* (* (/ -0.5 d) t_1) t_0)))
(if (<= t_2 2e+204)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (* (/ h l) t_4) (* t_4 0.5))))
(if (<= t_2 INFINITY)
(*
(fma (* -0.5 h) (* t_0 (* (* 0.25 t_0) (* t_1 t_3))) 1.0)
(/ (fabs d) (sqrt (* l h))))
(/
(* (fma (* (* (* (* t_0 t_0) 0.25) t_1) t_3) (* -0.5 h) 1.0) (fabs d))
(sqrt (* h l)))))))double code(double d, double h, double l, double M, double D) {
double t_0 = fmax(fabs(M), fabs(D));
double t_1 = fmin(fabs(M), fabs(D));
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((t_1 * t_0) / (2.0 * d)), 2.0)) * (h / l)));
double t_3 = t_1 / ((d * d) * l);
double t_4 = ((-0.5 / d) * t_1) * t_0;
double tmp;
if (t_2 <= 2e+204) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - (((h / l) * t_4) * (t_4 * 0.5)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma((-0.5 * h), (t_0 * ((0.25 * t_0) * (t_1 * t_3))), 1.0) * (fabs(d) / sqrt((l * h)));
} else {
tmp = (fma(((((t_0 * t_0) * 0.25) * t_1) * t_3), (-0.5 * h), 1.0) * fabs(d)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fmax(abs(M), abs(D)) t_1 = fmin(abs(M), abs(D)) t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(t_1 * t_0) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_3 = Float64(t_1 / Float64(Float64(d * d) * l)) t_4 = Float64(Float64(Float64(-0.5 / d) * t_1) * t_0) tmp = 0.0 if (t_2 <= 2e+204) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(h / l) * t_4) * Float64(t_4 * 0.5)))); elseif (t_2 <= Inf) tmp = Float64(fma(Float64(-0.5 * h), Float64(t_0 * Float64(Float64(0.25 * t_0) * Float64(t_1 * t_3))), 1.0) * Float64(abs(d) / sqrt(Float64(l * h)))); else tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(t_0 * t_0) * 0.25) * t_1) * t_3), Float64(-0.5 * h), 1.0) * abs(d)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Max[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(t$95$1 * t$95$0), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(-0.5 / d), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, 2e+204], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(h / l), $MachinePrecision] * t$95$4), $MachinePrecision] * N[(t$95$4 * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(t$95$0 * N[(N[(0.25 * t$95$0), $MachinePrecision] * N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 0.25), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-0.5 * h), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|M\right|, \left|D\right|\right)\\
t_1 := \mathsf{min}\left(\left|M\right|, \left|D\right|\right)\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_1 \cdot t\_0}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_3 := \frac{t\_1}{\left(d \cdot d\right) \cdot \ell}\\
t_4 := \left(\frac{-0.5}{d} \cdot t\_1\right) \cdot t\_0\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\frac{h}{\ell} \cdot t\_4\right) \cdot \left(t\_4 \cdot 0.5\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot h, t\_0 \cdot \left(\left(0.25 \cdot t\_0\right) \cdot \left(t\_1 \cdot t\_3\right)\right), 1\right) \cdot \frac{\left|d\right|}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\left(\left(t\_0 \cdot t\_0\right) \cdot 0.25\right) \cdot t\_1\right) \cdot t\_3, -0.5 \cdot h, 1\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e204Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval67.7%
Applied rewrites67.7%
if 2e204 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.7%
Applied rewrites61.7%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (fmax (fabs M) (fabs D)))
(t_1 (fmin (fabs M) (fabs D)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* t_1 t_0) (* 2.0 d)) 2.0)) (/ h l)))))
(t_3 (/ t_1 (* (* d d) l)))
(t_4 (* (* t_1 (/ -0.5 d)) t_0)))
(if (<= t_2 2e+204)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(- 1.0 (* (* t_4 (* t_4 0.5)) (/ h l))))
(if (<= t_2 INFINITY)
(*
(fma (* -0.5 h) (* t_0 (* (* 0.25 t_0) (* t_1 t_3))) 1.0)
(/ (fabs d) (sqrt (* l h))))
(/
(* (fma (* (* (* (* t_0 t_0) 0.25) t_1) t_3) (* -0.5 h) 1.0) (fabs d))
(sqrt (* h l)))))))double code(double d, double h, double l, double M, double D) {
double t_0 = fmax(fabs(M), fabs(D));
double t_1 = fmin(fabs(M), fabs(D));
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((t_1 * t_0) / (2.0 * d)), 2.0)) * (h / l)));
double t_3 = t_1 / ((d * d) * l);
double t_4 = (t_1 * (-0.5 / d)) * t_0;
double tmp;
if (t_2 <= 2e+204) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((t_4 * (t_4 * 0.5)) * (h / l)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma((-0.5 * h), (t_0 * ((0.25 * t_0) * (t_1 * t_3))), 1.0) * (fabs(d) / sqrt((l * h)));
} else {
tmp = (fma(((((t_0 * t_0) * 0.25) * t_1) * t_3), (-0.5 * h), 1.0) * fabs(d)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fmax(abs(M), abs(D)) t_1 = fmin(abs(M), abs(D)) t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(t_1 * t_0) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_3 = Float64(t_1 / Float64(Float64(d * d) * l)) t_4 = Float64(Float64(t_1 * Float64(-0.5 / d)) * t_0) tmp = 0.0 if (t_2 <= 2e+204) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(t_4 * Float64(t_4 * 0.5)) * Float64(h / l)))); elseif (t_2 <= Inf) tmp = Float64(fma(Float64(-0.5 * h), Float64(t_0 * Float64(Float64(0.25 * t_0) * Float64(t_1 * t_3))), 1.0) * Float64(abs(d) / sqrt(Float64(l * h)))); else tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(t_0 * t_0) * 0.25) * t_1) * t_3), Float64(-0.5 * h), 1.0) * abs(d)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Max[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Min[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(t$95$1 * t$95$0), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$1 * N[(-0.5 / d), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, 2e+204], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(t$95$4 * N[(t$95$4 * 0.5), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(t$95$0 * N[(N[(0.25 * t$95$0), $MachinePrecision] * N[(t$95$1 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 0.25), $MachinePrecision] * t$95$1), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-0.5 * h), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(\left|M\right|, \left|D\right|\right)\\
t_1 := \mathsf{min}\left(\left|M\right|, \left|D\right|\right)\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_1 \cdot t\_0}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_3 := \frac{t\_1}{\left(d \cdot d\right) \cdot \ell}\\
t_4 := \left(t\_1 \cdot \frac{-0.5}{d}\right) \cdot t\_0\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(t\_4 \cdot \left(t\_4 \cdot 0.5\right)\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot h, t\_0 \cdot \left(\left(0.25 \cdot t\_0\right) \cdot \left(t\_1 \cdot t\_3\right)\right), 1\right) \cdot \frac{\left|d\right|}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\left(\left(t\_0 \cdot t\_0\right) \cdot 0.25\right) \cdot t\_1\right) \cdot t\_3, -0.5 \cdot h, 1\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e204Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
if 2e204 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.7%
Applied rewrites61.7%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (fmin (fabs M) (fabs D)))
(t_1 (/ t_0 (* (* d d) l)))
(t_2 (fmax (fabs M) (fabs D)))
(t_3
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* t_0 t_2) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_3 2e+204)
(*
(* (sqrt (/ d l)) (sqrt (/ d h)))
(-
1.0
(* (* (* (* t_0 (/ -0.5 d)) t_2) (* -0.25 (/ (* t_2 t_0) d))) (/ h l))))
(if (<= t_3 INFINITY)
(*
(fma (* -0.5 h) (* t_2 (* (* 0.25 t_2) (* t_0 t_1))) 1.0)
(/ (fabs d) (sqrt (* l h))))
(/
(* (fma (* (* (* (* t_2 t_2) 0.25) t_0) t_1) (* -0.5 h) 1.0) (fabs d))
(sqrt (* h l)))))))double code(double d, double h, double l, double M, double D) {
double t_0 = fmin(fabs(M), fabs(D));
double t_1 = t_0 / ((d * d) * l);
double t_2 = fmax(fabs(M), fabs(D));
double t_3 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((t_0 * t_2) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_3 <= 2e+204) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * (1.0 - ((((t_0 * (-0.5 / d)) * t_2) * (-0.25 * ((t_2 * t_0) / d))) * (h / l)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma((-0.5 * h), (t_2 * ((0.25 * t_2) * (t_0 * t_1))), 1.0) * (fabs(d) / sqrt((l * h)));
} else {
tmp = (fma(((((t_2 * t_2) * 0.25) * t_0) * t_1), (-0.5 * h), 1.0) * fabs(d)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fmin(abs(M), abs(D)) t_1 = Float64(t_0 / Float64(Float64(d * d) * l)) t_2 = fmax(abs(M), abs(D)) t_3 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(t_0 * t_2) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_3 <= 2e+204) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * Float64(1.0 - Float64(Float64(Float64(Float64(t_0 * Float64(-0.5 / d)) * t_2) * Float64(-0.25 * Float64(Float64(t_2 * t_0) / d))) * Float64(h / l)))); elseif (t_3 <= Inf) tmp = Float64(fma(Float64(-0.5 * h), Float64(t_2 * Float64(Float64(0.25 * t_2) * Float64(t_0 * t_1))), 1.0) * Float64(abs(d) / sqrt(Float64(l * h)))); else tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(t_2 * t_2) * 0.25) * t_0) * t_1), Float64(-0.5 * h), 1.0) * abs(d)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Min[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(t$95$0 * t$95$2), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 2e+204], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(N[(t$95$0 * N[(-0.5 / d), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(-0.25 * N[(N[(t$95$2 * t$95$0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(t$95$2 * N[(N[(0.25 * t$95$2), $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t$95$2 * t$95$2), $MachinePrecision] * 0.25), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(-0.5 * h), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|M\right|, \left|D\right|\right)\\
t_1 := \frac{t\_0}{\left(d \cdot d\right) \cdot \ell}\\
t_2 := \mathsf{max}\left(\left|M\right|, \left|D\right|\right)\\
t_3 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_0 \cdot t\_2}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot \left(1 - \left(\left(\left(t\_0 \cdot \frac{-0.5}{d}\right) \cdot t\_2\right) \cdot \left(-0.25 \cdot \frac{t\_2 \cdot t\_0}{d}\right)\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot h, t\_2 \cdot \left(\left(0.25 \cdot t\_2\right) \cdot \left(t\_0 \cdot t\_1\right)\right), 1\right) \cdot \frac{\left|d\right|}{\sqrt{\ell \cdot h}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\left(\left(t\_2 \cdot t\_2\right) \cdot 0.25\right) \cdot t\_0\right) \cdot t\_1, -0.5 \cdot h, 1\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e204Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6465.9%
Applied rewrites65.9%
if 2e204 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.7%
Applied rewrites61.7%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (/ (fabs d) (sqrt (* l h))))
(t_1 (fmax M (fabs D)))
(t_2 (fmin M (fabs D)))
(t_3 (/ t_2 (* (* d d) l)))
(t_4
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* t_2 t_1) (* 2.0 d)) 2.0)) (/ h l)))))
(t_5 (* (/ t_1 (+ d d)) t_2)))
(if (<= t_4 0.0)
(* t_0 (- 1.0 (* (* t_5 (* t_5 0.5)) (/ h l))))
(if (<= t_4 2e+204)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
(if (<= t_4 INFINITY)
(* (fma (* -0.5 h) (* t_1 (* (* 0.25 t_1) (* t_2 t_3))) 1.0) t_0)
(/
(*
(fma (* (* (* (* t_1 t_1) 0.25) t_2) t_3) (* -0.5 h) 1.0)
(fabs d))
(sqrt (* h l))))))))double code(double d, double h, double l, double M, double D) {
double t_0 = fabs(d) / sqrt((l * h));
double t_1 = fmax(M, fabs(D));
double t_2 = fmin(M, fabs(D));
double t_3 = t_2 / ((d * d) * l);
double t_4 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((t_2 * t_1) / (2.0 * d)), 2.0)) * (h / l)));
double t_5 = (t_1 / (d + d)) * t_2;
double tmp;
if (t_4 <= 0.0) {
tmp = t_0 * (1.0 - ((t_5 * (t_5 * 0.5)) * (h / l)));
} else if (t_4 <= 2e+204) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
} else if (t_4 <= ((double) INFINITY)) {
tmp = fma((-0.5 * h), (t_1 * ((0.25 * t_1) * (t_2 * t_3))), 1.0) * t_0;
} else {
tmp = (fma(((((t_1 * t_1) * 0.25) * t_2) * t_3), (-0.5 * h), 1.0) * fabs(d)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(abs(d) / sqrt(Float64(l * h))) t_1 = fmax(M, abs(D)) t_2 = fmin(M, abs(D)) t_3 = Float64(t_2 / Float64(Float64(d * d) * l)) t_4 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(t_2 * t_1) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_5 = Float64(Float64(t_1 / Float64(d + d)) * t_2) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(t_0 * Float64(1.0 - Float64(Float64(t_5 * Float64(t_5 * 0.5)) * Float64(h / l)))); elseif (t_4 <= 2e+204) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0); elseif (t_4 <= Inf) tmp = Float64(fma(Float64(-0.5 * h), Float64(t_1 * Float64(Float64(0.25 * t_1) * Float64(t_2 * t_3))), 1.0) * t_0); else tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(t_1 * t_1) * 0.25) * t_2) * t_3), Float64(-0.5 * h), 1.0) * abs(d)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Max[M, N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Min[M, N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(t$95$2 * t$95$1), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$1 / N[(d + d), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(t$95$0 * N[(1.0 - N[(N[(t$95$5 * N[(t$95$5 * 0.5), $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+204], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(t$95$1 * N[(N[(0.25 * t$95$1), $MachinePrecision] * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] * 0.25), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(-0.5 * h), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
t_0 := \frac{\left|d\right|}{\sqrt{\ell \cdot h}}\\
t_1 := \mathsf{max}\left(M, \left|D\right|\right)\\
t_2 := \mathsf{min}\left(M, \left|D\right|\right)\\
t_3 := \frac{t\_2}{\left(d \cdot d\right) \cdot \ell}\\
t_4 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_2 \cdot t\_1}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_5 := \frac{t\_1}{d + d} \cdot t\_2\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;t\_0 \cdot \left(1 - \left(t\_5 \cdot \left(t\_5 \cdot 0.5\right)\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot h, t\_1 \cdot \left(\left(0.25 \cdot t\_1\right) \cdot \left(t\_2 \cdot t\_3\right)\right), 1\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\left(\left(t\_1 \cdot t\_1\right) \cdot 0.25\right) \cdot t\_2\right) \cdot t\_3, -0.5 \cdot h, 1\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lower-unsound-sqrt.f64N/A
sqrt-divN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-neg.f64N/A
lift-neg.f64N/A
frac-2negN/A
frac-timesN/A
lift-*.f64N/A
sqrt-divN/A
lower-unsound-sqrt.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
rem-sqrt-square-revN/A
Applied rewrites70.0%
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
count-2-revN/A
lower-+.f64N/A
lower-*.f64N/A
Applied rewrites69.5%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e204Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 2e204 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.7%
Applied rewrites61.7%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (fmin (fabs M) (fabs D)))
(t_1 (/ t_0 (* (* d d) l)))
(t_2 (fmax (fabs M) (fabs D)))
(t_3
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* t_0 t_2) (* 2.0 d)) 2.0)) (/ h l)))))
(t_4 (* (* (* t_2 t_2) 0.25) t_0))
(t_5 (/ (fabs d) (sqrt (* l h)))))
(if (<= t_3 0.0)
(* (fma (* -0.5 h) (* (/ t_4 (* l d)) (/ t_0 d)) 1.0) t_5)
(if (<= t_3 2e+204)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
(if (<= t_3 INFINITY)
(* (fma (* -0.5 h) (* t_2 (* (* 0.25 t_2) (* t_0 t_1))) 1.0) t_5)
(/ (* (fma (* t_4 t_1) (* -0.5 h) 1.0) (fabs d)) (sqrt (* h l))))))))double code(double d, double h, double l, double M, double D) {
double t_0 = fmin(fabs(M), fabs(D));
double t_1 = t_0 / ((d * d) * l);
double t_2 = fmax(fabs(M), fabs(D));
double t_3 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((t_0 * t_2) / (2.0 * d)), 2.0)) * (h / l)));
double t_4 = ((t_2 * t_2) * 0.25) * t_0;
double t_5 = fabs(d) / sqrt((l * h));
double tmp;
if (t_3 <= 0.0) {
tmp = fma((-0.5 * h), ((t_4 / (l * d)) * (t_0 / d)), 1.0) * t_5;
} else if (t_3 <= 2e+204) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma((-0.5 * h), (t_2 * ((0.25 * t_2) * (t_0 * t_1))), 1.0) * t_5;
} else {
tmp = (fma((t_4 * t_1), (-0.5 * h), 1.0) * fabs(d)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fmin(abs(M), abs(D)) t_1 = Float64(t_0 / Float64(Float64(d * d) * l)) t_2 = fmax(abs(M), abs(D)) t_3 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(t_0 * t_2) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_4 = Float64(Float64(Float64(t_2 * t_2) * 0.25) * t_0) t_5 = Float64(abs(d) / sqrt(Float64(l * h))) tmp = 0.0 if (t_3 <= 0.0) tmp = Float64(fma(Float64(-0.5 * h), Float64(Float64(t_4 / Float64(l * d)) * Float64(t_0 / d)), 1.0) * t_5); elseif (t_3 <= 2e+204) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0); elseif (t_3 <= Inf) tmp = Float64(fma(Float64(-0.5 * h), Float64(t_2 * Float64(Float64(0.25 * t_2) * Float64(t_0 * t_1))), 1.0) * t_5); else tmp = Float64(Float64(fma(Float64(t_4 * t_1), Float64(-0.5 * h), 1.0) * abs(d)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Min[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(t$95$0 * t$95$2), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 * t$95$2), $MachinePrecision] * 0.25), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(N[(t$95$4 / N[(l * d), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / d), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$5), $MachinePrecision], If[LessEqual[t$95$3, 2e+204], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(t$95$2 * N[(N[(0.25 * t$95$2), $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$5), $MachinePrecision], N[(N[(N[(N[(t$95$4 * t$95$1), $MachinePrecision] * N[(-0.5 * h), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|M\right|, \left|D\right|\right)\\
t_1 := \frac{t\_0}{\left(d \cdot d\right) \cdot \ell}\\
t_2 := \mathsf{max}\left(\left|M\right|, \left|D\right|\right)\\
t_3 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_0 \cdot t\_2}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_4 := \left(\left(t\_2 \cdot t\_2\right) \cdot 0.25\right) \cdot t\_0\\
t_5 := \frac{\left|d\right|}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot h, \frac{t\_4}{\ell \cdot d} \cdot \frac{t\_0}{d}, 1\right) \cdot t\_5\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-0.5 \cdot h, t\_2 \cdot \left(\left(0.25 \cdot t\_2\right) \cdot \left(t\_0 \cdot t\_1\right)\right), 1\right) \cdot t\_5\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_4 \cdot t\_1, -0.5 \cdot h, 1\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6465.5%
Applied rewrites65.5%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e204Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 2e204 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.7%
Applied rewrites61.7%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (fmin (fabs M) (fabs D)))
(t_1 (/ t_0 (* (* d d) l)))
(t_2 (sqrt (/ d h)))
(t_3 (fmax (fabs M) (fabs D)))
(t_4
(*
(fma (* -0.5 h) (* t_3 (* (* 0.25 t_3) (* t_0 t_1))) 1.0)
(/ (fabs d) (sqrt (* l h)))))
(t_5
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* t_0 t_3) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_5 -2e-162)
t_4
(if (<= t_5 0.0)
(* (* -1.0 (* d (sqrt (/ 1.0 (* d l))))) t_2)
(if (<= t_5 2e+204)
(* (* (sqrt (/ d l)) t_2) 1.0)
(if (<= t_5 INFINITY)
t_4
(/
(*
(fma (* (* (* (* t_3 t_3) 0.25) t_0) t_1) (* -0.5 h) 1.0)
(fabs d))
(sqrt (* h l)))))))))double code(double d, double h, double l, double M, double D) {
double t_0 = fmin(fabs(M), fabs(D));
double t_1 = t_0 / ((d * d) * l);
double t_2 = sqrt((d / h));
double t_3 = fmax(fabs(M), fabs(D));
double t_4 = fma((-0.5 * h), (t_3 * ((0.25 * t_3) * (t_0 * t_1))), 1.0) * (fabs(d) / sqrt((l * h)));
double t_5 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((t_0 * t_3) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_5 <= -2e-162) {
tmp = t_4;
} else if (t_5 <= 0.0) {
tmp = (-1.0 * (d * sqrt((1.0 / (d * l))))) * t_2;
} else if (t_5 <= 2e+204) {
tmp = (sqrt((d / l)) * t_2) * 1.0;
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_4;
} else {
tmp = (fma(((((t_3 * t_3) * 0.25) * t_0) * t_1), (-0.5 * h), 1.0) * fabs(d)) / sqrt((h * l));
}
return tmp;
}
function code(d, h, l, M, D) t_0 = fmin(abs(M), abs(D)) t_1 = Float64(t_0 / Float64(Float64(d * d) * l)) t_2 = sqrt(Float64(d / h)) t_3 = fmax(abs(M), abs(D)) t_4 = Float64(fma(Float64(-0.5 * h), Float64(t_3 * Float64(Float64(0.25 * t_3) * Float64(t_0 * t_1))), 1.0) * Float64(abs(d) / sqrt(Float64(l * h)))) t_5 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(t_0 * t_3) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_5 <= -2e-162) tmp = t_4; elseif (t_5 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(d * sqrt(Float64(1.0 / Float64(d * l))))) * t_2); elseif (t_5 <= 2e+204) tmp = Float64(Float64(sqrt(Float64(d / l)) * t_2) * 1.0); elseif (t_5 <= Inf) tmp = t_4; else tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(t_3 * t_3) * 0.25) * t_0) * t_1), Float64(-0.5 * h), 1.0) * abs(d)) / sqrt(Float64(h * l))); end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Min[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Abs[M], $MachinePrecision], N[Abs[D], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(t$95$3 * N[(N[(0.25 * t$95$3), $MachinePrecision] * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(t$95$0 * t$95$3), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -2e-162], t$95$4, If[LessEqual[t$95$5, 0.0], N[(N[(-1.0 * N[(d * N[Sqrt[N[(1.0 / N[(d * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$5, 2e+204], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$4, N[(N[(N[(N[(N[(N[(N[(t$95$3 * t$95$3), $MachinePrecision] * 0.25), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(-0.5 * h), $MachinePrecision] + 1.0), $MachinePrecision] * N[Abs[d], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(\left|M\right|, \left|D\right|\right)\\
t_1 := \frac{t\_0}{\left(d \cdot d\right) \cdot \ell}\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := \mathsf{max}\left(\left|M\right|, \left|D\right|\right)\\
t_4 := \mathsf{fma}\left(-0.5 \cdot h, t\_3 \cdot \left(\left(0.25 \cdot t\_3\right) \cdot \left(t\_0 \cdot t\_1\right)\right), 1\right) \cdot \frac{\left|d\right|}{\sqrt{\ell \cdot h}}\\
t_5 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{t\_0 \cdot t\_3}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_5 \leq -2 \cdot 10^{-162}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{d \cdot \ell}}\right)\right) \cdot t\_2\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t\_2\right) \cdot 1\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(\left(\left(t\_3 \cdot t\_3\right) \cdot 0.25\right) \cdot t\_0\right) \cdot t\_1, -0.5 \cdot h, 1\right) \cdot \left|d\right|}{\sqrt{h \cdot \ell}}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-162 or 2e204 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.7%
Applied rewrites61.7%
if -1.9999999999999999e-162 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Applied rewrites43.9%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e204Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_1 (sqrt (/ d h)))
(t_2
(*
(fma (* -0.5 h) (* D (* (* 0.25 D) (* M (/ M (* (* d d) l))))) 1.0)
(/ (fabs d) (sqrt (* l h))))))
(if (<= t_0 -2e-162)
t_2
(if (<= t_0 0.0)
(* (* -1.0 (* d (sqrt (/ 1.0 (* d l))))) t_1)
(if (<= t_0 2e+204) (* (* (sqrt (/ d l)) t_1) 1.0) t_2)))))double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = sqrt((d / h));
double t_2 = fma((-0.5 * h), (D * ((0.25 * D) * (M * (M / ((d * d) * l))))), 1.0) * (fabs(d) / sqrt((l * h)));
double tmp;
if (t_0 <= -2e-162) {
tmp = t_2;
} else if (t_0 <= 0.0) {
tmp = (-1.0 * (d * sqrt((1.0 / (d * l))))) * t_1;
} else if (t_0 <= 2e+204) {
tmp = (sqrt((d / l)) * t_1) * 1.0;
} else {
tmp = t_2;
}
return tmp;
}
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_1 = sqrt(Float64(d / h)) t_2 = Float64(fma(Float64(-0.5 * h), Float64(D * Float64(Float64(0.25 * D) * Float64(M * Float64(M / Float64(Float64(d * d) * l))))), 1.0) * Float64(abs(d) / sqrt(Float64(l * h)))) tmp = 0.0 if (t_0 <= -2e-162) tmp = t_2; elseif (t_0 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(d * sqrt(Float64(1.0 / Float64(d * l))))) * t_1); elseif (t_0 <= 2e+204) tmp = Float64(Float64(sqrt(Float64(d / l)) * t_1) * 1.0); else tmp = t_2; end return tmp end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(-0.5 * h), $MachinePrecision] * N[(D * N[(N[(0.25 * D), $MachinePrecision] * N[(M * N[(M / N[(N[(d * d), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[Abs[d], $MachinePrecision] / N[Sqrt[N[(l * h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-162], t$95$2, If[LessEqual[t$95$0, 0.0], N[(N[(-1.0 * N[(d * N[Sqrt[N[(1.0 / N[(d * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$0, 2e+204], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] * 1.0), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := \sqrt{\frac{d}{h}}\\
t_2 := \mathsf{fma}\left(-0.5 \cdot h, D \cdot \left(\left(0.25 \cdot D\right) \cdot \left(M \cdot \frac{M}{\left(d \cdot d\right) \cdot \ell}\right)\right), 1\right) \cdot \frac{\left|d\right|}{\sqrt{\ell \cdot h}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-162}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{d \cdot \ell}}\right)\right) \cdot t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+204}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t\_1\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-162 or 2e204 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.7%
Applied rewrites61.7%
if -1.9999999999999999e-162 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Applied rewrites43.9%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 2e204Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_2 (sqrt (/ d h)))
(t_3 (* d (sqrt (/ 1.0 (* d l))))))
(if (<= t_1 -1e-130)
(* t_3 (* -1.0 (* d (sqrt (/ 1.0 (* d h))))))
(if (<= t_1 0.0)
(* (* -1.0 t_3) t_2)
(if (<= t_1 1e+212)
(* (* t_0 t_2) 1.0)
(if (<= t_1 INFINITY)
(/ (/ (* (sqrt (* d h)) (sqrt (* d l))) l) h)
(/ (* (* -1.0 (* d (sqrt (/ h d)))) t_0) h)))))))double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = sqrt((d / h));
double t_3 = d * sqrt((1.0 / (d * l)));
double tmp;
if (t_1 <= -1e-130) {
tmp = t_3 * (-1.0 * (d * sqrt((1.0 / (d * h)))));
} else if (t_1 <= 0.0) {
tmp = (-1.0 * t_3) * t_2;
} else if (t_1 <= 1e+212) {
tmp = (t_0 * t_2) * 1.0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h;
} else {
tmp = ((-1.0 * (d * sqrt((h / d)))) * t_0) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = Math.sqrt((d / h));
double t_3 = d * Math.sqrt((1.0 / (d * l)));
double tmp;
if (t_1 <= -1e-130) {
tmp = t_3 * (-1.0 * (d * Math.sqrt((1.0 / (d * h)))));
} else if (t_1 <= 0.0) {
tmp = (-1.0 * t_3) * t_2;
} else if (t_1 <= 1e+212) {
tmp = (t_0 * t_2) * 1.0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.sqrt((d * h)) * Math.sqrt((d * l))) / l) / h;
} else {
tmp = ((-1.0 * (d * Math.sqrt((h / d)))) * t_0) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_2 = math.sqrt((d / h)) t_3 = d * math.sqrt((1.0 / (d * l))) tmp = 0 if t_1 <= -1e-130: tmp = t_3 * (-1.0 * (d * math.sqrt((1.0 / (d * h))))) elif t_1 <= 0.0: tmp = (-1.0 * t_3) * t_2 elif t_1 <= 1e+212: tmp = (t_0 * t_2) * 1.0 elif t_1 <= math.inf: tmp = ((math.sqrt((d * h)) * math.sqrt((d * l))) / l) / h else: tmp = ((-1.0 * (d * math.sqrt((h / d)))) * t_0) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_2 = sqrt(Float64(d / h)) t_3 = Float64(d * sqrt(Float64(1.0 / Float64(d * l)))) tmp = 0.0 if (t_1 <= -1e-130) tmp = Float64(t_3 * Float64(-1.0 * Float64(d * sqrt(Float64(1.0 / Float64(d * h)))))); elseif (t_1 <= 0.0) tmp = Float64(Float64(-1.0 * t_3) * t_2); elseif (t_1 <= 1e+212) tmp = Float64(Float64(t_0 * t_2) * 1.0); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(sqrt(Float64(d * h)) * sqrt(Float64(d * l))) / l) / h); else tmp = Float64(Float64(Float64(-1.0 * Float64(d * sqrt(Float64(h / d)))) * t_0) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_2 = sqrt((d / h)); t_3 = d * sqrt((1.0 / (d * l))); tmp = 0.0; if (t_1 <= -1e-130) tmp = t_3 * (-1.0 * (d * sqrt((1.0 / (d * h))))); elseif (t_1 <= 0.0) tmp = (-1.0 * t_3) * t_2; elseif (t_1 <= 1e+212) tmp = (t_0 * t_2) * 1.0; elseif (t_1 <= Inf) tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h; else tmp = ((-1.0 * (d * sqrt((h / d)))) * t_0) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(d * N[Sqrt[N[(1.0 / N[(d * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-130], N[(t$95$3 * N[(-1.0 * N[(d * N[Sqrt[N[(1.0 / N[(d * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(-1.0 * t$95$3), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e+212], N[(N[(t$95$0 * t$95$2), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(N[Sqrt[N[(d * h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(-1.0 * N[(d * N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
t_3 := d \cdot \sqrt{\frac{1}{d \cdot \ell}}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-130}:\\
\;\;\;\;t\_3 \cdot \left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{d \cdot h}}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-1 \cdot t\_3\right) \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+212}:\\
\;\;\;\;\left(t\_0 \cdot t\_2\right) \cdot 1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\frac{\sqrt{d \cdot h} \cdot \sqrt{d \cdot \ell}}{\ell}}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot t\_0}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.0000000000000001e-130Initial program 66.7%
Applied rewrites43.9%
Taylor expanded in d around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6424.1%
Applied rewrites24.1%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6416.2%
Applied rewrites16.2%
if -1.0000000000000001e-130 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Applied rewrites43.9%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.9999999999999991e211Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 9.9999999999999991e211 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in l around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6411.8%
Applied rewrites11.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d l)))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_2 (sqrt (/ d h))))
(if (<= t_1 -1e-130)
(* -1.0 (sqrt (/ (pow d 2.0) (* h l))))
(if (<= t_1 0.0)
(* (* -1.0 (* d (sqrt (/ 1.0 (* d l))))) t_2)
(if (<= t_1 1e+212)
(* (* t_0 t_2) 1.0)
(if (<= t_1 INFINITY)
(/ (/ (* (sqrt (* d h)) (sqrt (* d l))) l) h)
(/ (* (* -1.0 (* d (sqrt (/ h d)))) t_0) h)))))))double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / l));
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = sqrt((d / h));
double tmp;
if (t_1 <= -1e-130) {
tmp = -1.0 * sqrt((pow(d, 2.0) / (h * l)));
} else if (t_1 <= 0.0) {
tmp = (-1.0 * (d * sqrt((1.0 / (d * l))))) * t_2;
} else if (t_1 <= 1e+212) {
tmp = (t_0 * t_2) * 1.0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h;
} else {
tmp = ((-1.0 * (d * sqrt((h / d)))) * t_0) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / l));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = Math.sqrt((d / h));
double tmp;
if (t_1 <= -1e-130) {
tmp = -1.0 * Math.sqrt((Math.pow(d, 2.0) / (h * l)));
} else if (t_1 <= 0.0) {
tmp = (-1.0 * (d * Math.sqrt((1.0 / (d * l))))) * t_2;
} else if (t_1 <= 1e+212) {
tmp = (t_0 * t_2) * 1.0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.sqrt((d * h)) * Math.sqrt((d * l))) / l) / h;
} else {
tmp = ((-1.0 * (d * Math.sqrt((h / d)))) * t_0) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / l)) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_2 = math.sqrt((d / h)) tmp = 0 if t_1 <= -1e-130: tmp = -1.0 * math.sqrt((math.pow(d, 2.0) / (h * l))) elif t_1 <= 0.0: tmp = (-1.0 * (d * math.sqrt((1.0 / (d * l))))) * t_2 elif t_1 <= 1e+212: tmp = (t_0 * t_2) * 1.0 elif t_1 <= math.inf: tmp = ((math.sqrt((d * h)) * math.sqrt((d * l))) / l) / h else: tmp = ((-1.0 * (d * math.sqrt((h / d)))) * t_0) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / l)) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_2 = sqrt(Float64(d / h)) tmp = 0.0 if (t_1 <= -1e-130) tmp = Float64(-1.0 * sqrt(Float64((d ^ 2.0) / Float64(h * l)))); elseif (t_1 <= 0.0) tmp = Float64(Float64(-1.0 * Float64(d * sqrt(Float64(1.0 / Float64(d * l))))) * t_2); elseif (t_1 <= 1e+212) tmp = Float64(Float64(t_0 * t_2) * 1.0); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(sqrt(Float64(d * h)) * sqrt(Float64(d * l))) / l) / h); else tmp = Float64(Float64(Float64(-1.0 * Float64(d * sqrt(Float64(h / d)))) * t_0) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / l)); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_2 = sqrt((d / h)); tmp = 0.0; if (t_1 <= -1e-130) tmp = -1.0 * sqrt(((d ^ 2.0) / (h * l))); elseif (t_1 <= 0.0) tmp = (-1.0 * (d * sqrt((1.0 / (d * l))))) * t_2; elseif (t_1 <= 1e+212) tmp = (t_0 * t_2) * 1.0; elseif (t_1 <= Inf) tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h; else tmp = ((-1.0 * (d * sqrt((h / d)))) * t_0) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, -1e-130], N[(-1.0 * N[Sqrt[N[(N[Power[d, 2.0], $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(-1.0 * N[(d * N[Sqrt[N[(1.0 / N[(d * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e+212], N[(N[(t$95$0 * t$95$2), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(N[Sqrt[N[(d * h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(-1.0 * N[(d * N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \sqrt{\frac{d}{\ell}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_2 := \sqrt{\frac{d}{h}}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-130}:\\
\;\;\;\;-1 \cdot \sqrt{\frac{{d}^{2}}{h \cdot \ell}}\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-1 \cdot \left(d \cdot \sqrt{\frac{1}{d \cdot \ell}}\right)\right) \cdot t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+212}:\\
\;\;\;\;\left(t\_0 \cdot t\_2\right) \cdot 1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\frac{\sqrt{d \cdot h} \cdot \sqrt{d \cdot \ell}}{\ell}}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot t\_0}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.0000000000000001e-130Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in h around -inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f6412.0%
Applied rewrites12.0%
if -1.0000000000000001e-130 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Applied rewrites43.9%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6424.3%
Applied rewrites24.3%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.9999999999999991e211Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 9.9999999999999991e211 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in l around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6411.8%
Applied rewrites11.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_1 (sqrt (/ d l))))
(if (<= t_0 0.0)
(/ (* d (* h (sqrt (/ 1.0 (* h l))))) h)
(if (<= t_0 1e+212)
(* (* t_1 (sqrt (/ d h))) 1.0)
(if (<= t_0 INFINITY)
(/ (/ (* (sqrt (* d h)) (sqrt (* d l))) l) h)
(/ (* (* -1.0 (* d (sqrt (/ h d)))) t_1) h))))))double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = sqrt((d / l));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 1e+212) {
tmp = (t_1 * sqrt((d / h))) * 1.0;
} else if (t_0 <= ((double) INFINITY)) {
tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h;
} else {
tmp = ((-1.0 * (d * sqrt((h / d)))) * t_1) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = Math.sqrt((d / l));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * Math.sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 1e+212) {
tmp = (t_1 * Math.sqrt((d / h))) * 1.0;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.sqrt((d * h)) * Math.sqrt((d * l))) / l) / h;
} else {
tmp = ((-1.0 * (d * Math.sqrt((h / d)))) * t_1) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_1 = math.sqrt((d / l)) tmp = 0 if t_0 <= 0.0: tmp = (d * (h * math.sqrt((1.0 / (h * l))))) / h elif t_0 <= 1e+212: tmp = (t_1 * math.sqrt((d / h))) * 1.0 elif t_0 <= math.inf: tmp = ((math.sqrt((d * h)) * math.sqrt((d * l))) / l) / h else: tmp = ((-1.0 * (d * math.sqrt((h / d)))) * t_1) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_1 = sqrt(Float64(d / l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(d * Float64(h * sqrt(Float64(1.0 / Float64(h * l))))) / h); elseif (t_0 <= 1e+212) tmp = Float64(Float64(t_1 * sqrt(Float64(d / h))) * 1.0); elseif (t_0 <= Inf) tmp = Float64(Float64(Float64(sqrt(Float64(d * h)) * sqrt(Float64(d * l))) / l) / h); else tmp = Float64(Float64(Float64(-1.0 * Float64(d * sqrt(Float64(h / d)))) * t_1) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_1 = sqrt((d / l)); tmp = 0.0; if (t_0 <= 0.0) tmp = (d * (h * sqrt((1.0 / (h * l))))) / h; elseif (t_0 <= 1e+212) tmp = (t_1 * sqrt((d / h))) * 1.0; elseif (t_0 <= Inf) tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h; else tmp = ((-1.0 * (d * sqrt((h / d)))) * t_1) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(d * N[(h * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$0, 1e+212], N[(N[(t$95$1 * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(N[Sqrt[N[(d * h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(-1.0 * N[(d * N[Sqrt[N[(h / d), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / h), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := \sqrt{\frac{d}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{d \cdot \left(h \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}{h}\\
\mathbf{elif}\;t\_0 \leq 10^{+212}:\\
\;\;\;\;\left(t\_1 \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\frac{\sqrt{d \cdot h} \cdot \sqrt{d \cdot \ell}}{\ell}}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-1 \cdot \left(d \cdot \sqrt{\frac{h}{d}}\right)\right) \cdot t\_1}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
Taylor expanded in h around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.7%
Applied rewrites25.7%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.9999999999999991e211Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 9.9999999999999991e211 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in l around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6411.8%
Applied rewrites11.8%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_0 0.0)
(/ (* d (* h (sqrt (/ 1.0 (* h l))))) h)
(if (<= t_0 1e+212)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
(if (<= t_0 INFINITY)
(/ (/ (* (sqrt (* d h)) (sqrt (* d l))) l) h)
(/ (* -1.0 (* d (sqrt (/ h l)))) h))))))double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 1e+212) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
} else if (t_0 <= ((double) INFINITY)) {
tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h;
} else {
tmp = (-1.0 * (d * sqrt((h / l)))) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * Math.sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 1e+212) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.sqrt((d * h)) * Math.sqrt((d * l))) / l) / h;
} else {
tmp = (-1.0 * (d * Math.sqrt((h / l)))) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) tmp = 0 if t_0 <= 0.0: tmp = (d * (h * math.sqrt((1.0 / (h * l))))) / h elif t_0 <= 1e+212: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0 elif t_0 <= math.inf: tmp = ((math.sqrt((d * h)) * math.sqrt((d * l))) / l) / h else: tmp = (-1.0 * (d * math.sqrt((h / l)))) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(d * Float64(h * sqrt(Float64(1.0 / Float64(h * l))))) / h); elseif (t_0 <= 1e+212) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0); elseif (t_0 <= Inf) tmp = Float64(Float64(Float64(sqrt(Float64(d * h)) * sqrt(Float64(d * l))) / l) / h); else tmp = Float64(Float64(-1.0 * Float64(d * sqrt(Float64(h / l)))) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_0 <= 0.0) tmp = (d * (h * sqrt((1.0 / (h * l))))) / h; elseif (t_0 <= 1e+212) tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0; elseif (t_0 <= Inf) tmp = ((sqrt((d * h)) * sqrt((d * l))) / l) / h; else tmp = (-1.0 * (d * sqrt((h / l)))) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(d * N[(h * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$0, 1e+212], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(N[Sqrt[N[(d * h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / h), $MachinePrecision], N[(N[(-1.0 * N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{d \cdot \left(h \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}{h}\\
\mathbf{elif}\;t\_0 \leq 10^{+212}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\frac{\sqrt{d \cdot h} \cdot \sqrt{d \cdot \ell}}{\ell}}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
Taylor expanded in h around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.7%
Applied rewrites25.7%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.9999999999999991e211Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 9.9999999999999991e211 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in l around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6432.1%
Applied rewrites32.1%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6413.6%
Applied rewrites13.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(-
1.0
(* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l))))))
(if (<= t_0 0.0)
(/ (* d (* h (sqrt (/ 1.0 (* h l))))) h)
(if (<= t_0 1e+212)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
(if (<= t_0 INFINITY)
(/ (* (sqrt (* d h)) (sqrt (* d l))) (* h l))
(/ (* -1.0 (* d (sqrt (/ h l)))) h))))))double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 1e+212) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
} else if (t_0 <= ((double) INFINITY)) {
tmp = (sqrt((d * h)) * sqrt((d * l))) / (h * l);
} else {
tmp = (-1.0 * (d * sqrt((h / l)))) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * Math.sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 1e+212) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (Math.sqrt((d * h)) * Math.sqrt((d * l))) / (h * l);
} else {
tmp = (-1.0 * (d * Math.sqrt((h / l)))) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) tmp = 0 if t_0 <= 0.0: tmp = (d * (h * math.sqrt((1.0 / (h * l))))) / h elif t_0 <= 1e+212: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0 elif t_0 <= math.inf: tmp = (math.sqrt((d * h)) * math.sqrt((d * l))) / (h * l) else: tmp = (-1.0 * (d * math.sqrt((h / l)))) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(d * Float64(h * sqrt(Float64(1.0 / Float64(h * l))))) / h); elseif (t_0 <= 1e+212) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0); elseif (t_0 <= Inf) tmp = Float64(Float64(sqrt(Float64(d * h)) * sqrt(Float64(d * l))) / Float64(h * l)); else tmp = Float64(Float64(-1.0 * Float64(d * sqrt(Float64(h / l)))) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); tmp = 0.0; if (t_0 <= 0.0) tmp = (d * (h * sqrt((1.0 / (h * l))))) / h; elseif (t_0 <= 1e+212) tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0; elseif (t_0 <= Inf) tmp = (sqrt((d * h)) * sqrt((d * l))) / (h * l); else tmp = (-1.0 * (d * sqrt((h / l)))) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(d * N[(h * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$0, 1e+212], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[Sqrt[N[(d * h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(h * l), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{d \cdot \left(h \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}{h}\\
\mathbf{elif}\;t\_0 \leq 10^{+212}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\sqrt{d \cdot h} \cdot \sqrt{d \cdot \ell}}{h \cdot \ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
Taylor expanded in h around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.7%
Applied rewrites25.7%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 9.9999999999999991e211Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 9.9999999999999991e211 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in l around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-*.f6429.8%
Applied rewrites29.8%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6413.6%
Applied rewrites13.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_1 (* d (sqrt (/ h l)))))
(if (<= t_0 0.0)
(/ (* d (* h (sqrt (/ 1.0 (* h l))))) h)
(if (<= t_0 2e+181)
(* (* (sqrt (/ d l)) (sqrt (/ d h))) 1.0)
(if (<= t_0 INFINITY) (/ t_1 h) (/ (* -1.0 t_1) h))))))double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = d * sqrt((h / l));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 2e+181) {
tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0;
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_1 / h;
} else {
tmp = (-1.0 * t_1) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = d * Math.sqrt((h / l));
double tmp;
if (t_0 <= 0.0) {
tmp = (d * (h * Math.sqrt((1.0 / (h * l))))) / h;
} else if (t_0 <= 2e+181) {
tmp = (Math.sqrt((d / l)) * Math.sqrt((d / h))) * 1.0;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_1 / h;
} else {
tmp = (-1.0 * t_1) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_1 = d * math.sqrt((h / l)) tmp = 0 if t_0 <= 0.0: tmp = (d * (h * math.sqrt((1.0 / (h * l))))) / h elif t_0 <= 2e+181: tmp = (math.sqrt((d / l)) * math.sqrt((d / h))) * 1.0 elif t_0 <= math.inf: tmp = t_1 / h else: tmp = (-1.0 * t_1) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_1 = Float64(d * sqrt(Float64(h / l))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(Float64(d * Float64(h * sqrt(Float64(1.0 / Float64(h * l))))) / h); elseif (t_0 <= 2e+181) tmp = Float64(Float64(sqrt(Float64(d / l)) * sqrt(Float64(d / h))) * 1.0); elseif (t_0 <= Inf) tmp = Float64(t_1 / h); else tmp = Float64(Float64(-1.0 * t_1) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_1 = d * sqrt((h / l)); tmp = 0.0; if (t_0 <= 0.0) tmp = (d * (h * sqrt((1.0 / (h * l))))) / h; elseif (t_0 <= 2e+181) tmp = (sqrt((d / l)) * sqrt((d / h))) * 1.0; elseif (t_0 <= Inf) tmp = t_1 / h; else tmp = (-1.0 * t_1) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(d * N[(h * N[Sqrt[N[(1.0 / N[(h * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], If[LessEqual[t$95$0, 2e+181], N[(N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(t$95$1 / h), $MachinePrecision], N[(N[(-1.0 * t$95$1), $MachinePrecision] / h), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := d \cdot \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{d \cdot \left(h \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)}{h}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+181}:\\
\;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right) \cdot 1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{t\_1}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot t\_1}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -0.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
Taylor expanded in h around inf
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-*.f6425.7%
Applied rewrites25.7%
if -0.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.9999999999999998e181Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 1.9999999999999998e181 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6413.6%
Applied rewrites13.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ d h)))
(t_1 (sqrt (/ d l)))
(t_2
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_3 (* d (sqrt (/ h l)))))
(if (<= t_2 -2e-162)
(* -1.0 (* t_0 t_1))
(if (<= t_2 2e+181)
(* (* t_1 t_0) 1.0)
(if (<= t_2 INFINITY) (/ t_3 h) (/ (* -1.0 t_3) h))))))double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((d / h));
double t_1 = sqrt((d / l));
double t_2 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_3 = d * sqrt((h / l));
double tmp;
if (t_2 <= -2e-162) {
tmp = -1.0 * (t_0 * t_1);
} else if (t_2 <= 2e+181) {
tmp = (t_1 * t_0) * 1.0;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3 / h;
} else {
tmp = (-1.0 * t_3) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((d / h));
double t_1 = Math.sqrt((d / l));
double t_2 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_3 = d * Math.sqrt((h / l));
double tmp;
if (t_2 <= -2e-162) {
tmp = -1.0 * (t_0 * t_1);
} else if (t_2 <= 2e+181) {
tmp = (t_1 * t_0) * 1.0;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3 / h;
} else {
tmp = (-1.0 * t_3) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((d / h)) t_1 = math.sqrt((d / l)) t_2 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_3 = d * math.sqrt((h / l)) tmp = 0 if t_2 <= -2e-162: tmp = -1.0 * (t_0 * t_1) elif t_2 <= 2e+181: tmp = (t_1 * t_0) * 1.0 elif t_2 <= math.inf: tmp = t_3 / h else: tmp = (-1.0 * t_3) / h return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(d / h)) t_1 = sqrt(Float64(d / l)) t_2 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_3 = Float64(d * sqrt(Float64(h / l))) tmp = 0.0 if (t_2 <= -2e-162) tmp = Float64(-1.0 * Float64(t_0 * t_1)); elseif (t_2 <= 2e+181) tmp = Float64(Float64(t_1 * t_0) * 1.0); elseif (t_2 <= Inf) tmp = Float64(t_3 / h); else tmp = Float64(Float64(-1.0 * t_3) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((d / h)); t_1 = sqrt((d / l)); t_2 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_3 = d * sqrt((h / l)); tmp = 0.0; if (t_2 <= -2e-162) tmp = -1.0 * (t_0 * t_1); elseif (t_2 <= 2e+181) tmp = (t_1 * t_0) * 1.0; elseif (t_2 <= Inf) tmp = t_3 / h; else tmp = (-1.0 * t_3) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-162], N[(-1.0 * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+181], N[(N[(t$95$1 * t$95$0), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(t$95$3 / h), $MachinePrecision], N[(N[(-1.0 * t$95$3), $MachinePrecision] / h), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \sqrt{\frac{d}{h}}\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_3 := d \cdot \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-162}:\\
\;\;\;\;-1 \cdot \left(t\_0 \cdot t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+181}:\\
\;\;\;\;\left(t\_1 \cdot t\_0\right) \cdot 1\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{t\_3}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot t\_3}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-162Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in h around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f649.4%
Applied rewrites9.4%
if -1.9999999999999999e-162 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < 1.9999999999999998e181Initial program 66.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
lift-pow.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6466.7%
Applied rewrites66.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lift-+.f64N/A
associate-*l/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites66.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2%
lift-/.f64N/A
metadata-eval66.2%
Applied rewrites66.2%
Taylor expanded in d around inf
Applied rewrites40.0%
if 1.9999999999999998e181 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6413.6%
Applied rewrites13.6%
(FPCore (d h l M D)
:precision binary64
(if (<= d -4.4e-159)
(* -1.0 (/ (* d (sqrt (/ -1.0 h))) (sqrt (- l))))
(if (<= d 8.5e-189)
(/ (* -1.0 (* d (sqrt (/ h l)))) h)
(/ (* d (/ (sqrt h) (sqrt l))) h))))double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.4e-159) {
tmp = -1.0 * ((d * sqrt((-1.0 / h))) / sqrt(-l));
} else if (d <= 8.5e-189) {
tmp = (-1.0 * (d * sqrt((h / l)))) / h;
} else {
tmp = (d * (sqrt(h) / sqrt(l))) / h;
}
return tmp;
}
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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if (d <= (-4.4d-159)) then
tmp = (-1.0d0) * ((d * sqrt(((-1.0d0) / h))) / sqrt(-l))
else if (d <= 8.5d-189) then
tmp = ((-1.0d0) * (d * sqrt((h / l)))) / h
else
tmp = (d * (sqrt(h) / sqrt(l))) / h
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if (d <= -4.4e-159) {
tmp = -1.0 * ((d * Math.sqrt((-1.0 / h))) / Math.sqrt(-l));
} else if (d <= 8.5e-189) {
tmp = (-1.0 * (d * Math.sqrt((h / l)))) / h;
} else {
tmp = (d * (Math.sqrt(h) / Math.sqrt(l))) / h;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if d <= -4.4e-159: tmp = -1.0 * ((d * math.sqrt((-1.0 / h))) / math.sqrt(-l)) elif d <= 8.5e-189: tmp = (-1.0 * (d * math.sqrt((h / l)))) / h else: tmp = (d * (math.sqrt(h) / math.sqrt(l))) / h return tmp
function code(d, h, l, M, D) tmp = 0.0 if (d <= -4.4e-159) tmp = Float64(-1.0 * Float64(Float64(d * sqrt(Float64(-1.0 / h))) / sqrt(Float64(-l)))); elseif (d <= 8.5e-189) tmp = Float64(Float64(-1.0 * Float64(d * sqrt(Float64(h / l)))) / h); else tmp = Float64(Float64(d * Float64(sqrt(h) / sqrt(l))) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if (d <= -4.4e-159) tmp = -1.0 * ((d * sqrt((-1.0 / h))) / sqrt(-l)); elseif (d <= 8.5e-189) tmp = (-1.0 * (d * sqrt((h / l)))) / h; else tmp = (d * (sqrt(h) / sqrt(l))) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[d, -4.4e-159], N[(-1.0 * N[(N[(d * N[Sqrt[N[(-1.0 / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 8.5e-189], N[(N[(-1.0 * N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[(d * N[(N[Sqrt[h], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;d \leq -4.4 \cdot 10^{-159}:\\
\;\;\;\;-1 \cdot \frac{d \cdot \sqrt{\frac{-1}{h}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;d \leq 8.5 \cdot 10^{-189}:\\
\;\;\;\;\frac{-1 \cdot \left(d \cdot \sqrt{\frac{h}{\ell}}\right)}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot \frac{\sqrt{h}}{\sqrt{\ell}}}{h}\\
\end{array}
if d < -4.4000000000000002e-159Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6424.6%
Applied rewrites24.6%
if -4.4000000000000002e-159 < d < 8.5000000000000007e-189Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6413.6%
Applied rewrites13.6%
if 8.5000000000000007e-189 < d Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
lift-sqrt.f64N/A
lift-/.f64N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lower-unsound-sqrt.f6423.1%
Applied rewrites23.1%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_1 (* d (sqrt (/ h l)))))
(if (<= t_0 -2e-162)
(* -1.0 (* (sqrt (/ d h)) (sqrt (/ d l))))
(if (<= t_0 INFINITY) (/ t_1 h) (/ (* -1.0 t_1) h)))))double code(double d, double h, double l, double M, double D) {
double t_0 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = d * sqrt((h / l));
double tmp;
if (t_0 <= -2e-162) {
tmp = -1.0 * (sqrt((d / h)) * sqrt((d / l)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_1 / h;
} else {
tmp = (-1.0 * t_1) / h;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_1 = d * Math.sqrt((h / l));
double tmp;
if (t_0 <= -2e-162) {
tmp = -1.0 * (Math.sqrt((d / h)) * Math.sqrt((d / l)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = t_1 / h;
} else {
tmp = (-1.0 * t_1) / h;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_1 = d * math.sqrt((h / l)) tmp = 0 if t_0 <= -2e-162: tmp = -1.0 * (math.sqrt((d / h)) * math.sqrt((d / l))) elif t_0 <= math.inf: tmp = t_1 / h else: tmp = (-1.0 * t_1) / h return tmp
function code(d, h, l, M, D) t_0 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_1 = Float64(d * sqrt(Float64(h / l))) tmp = 0.0 if (t_0 <= -2e-162) tmp = Float64(-1.0 * Float64(sqrt(Float64(d / h)) * sqrt(Float64(d / l)))); elseif (t_0 <= Inf) tmp = Float64(t_1 / h); else tmp = Float64(Float64(-1.0 * t_1) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_1 = d * sqrt((h / l)); tmp = 0.0; if (t_0 <= -2e-162) tmp = -1.0 * (sqrt((d / h)) * sqrt((d / l))); elseif (t_0 <= Inf) tmp = t_1 / h; else tmp = (-1.0 * t_1) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-162], N[(-1.0 * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(t$95$1 / h), $MachinePrecision], N[(N[(-1.0 * t$95$1), $MachinePrecision] / h), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_1 := d \cdot \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-162}:\\
\;\;\;\;-1 \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{t\_1}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot t\_1}{h}\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-162Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
Taylor expanded in h around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f649.4%
Applied rewrites9.4%
if -1.9999999999999999e-162 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6413.6%
Applied rewrites13.6%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (* d (sqrt (/ h l))))
(t_1
(*
(* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
(- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(t_2 (/ (* -1.0 t_0) h)))
(if (<= t_1 -2e-162) t_2 (if (<= t_1 INFINITY) (/ t_0 h) t_2))))double code(double d, double h, double l, double M, double D) {
double t_0 = d * sqrt((h / l));
double t_1 = (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = (-1.0 * t_0) / h;
double tmp;
if (t_1 <= -2e-162) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_0 / h;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double d, double h, double l, double M, double D) {
double t_0 = d * Math.sqrt((h / l));
double t_1 = (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
double t_2 = (-1.0 * t_0) / h;
double tmp;
if (t_1 <= -2e-162) {
tmp = t_2;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_0 / h;
} else {
tmp = t_2;
}
return tmp;
}
def code(d, h, l, M, D): t_0 = d * math.sqrt((h / l)) t_1 = (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))) t_2 = (-1.0 * t_0) / h tmp = 0 if t_1 <= -2e-162: tmp = t_2 elif t_1 <= math.inf: tmp = t_0 / h else: tmp = t_2 return tmp
function code(d, h, l, M, D) t_0 = Float64(d * sqrt(Float64(h / l))) t_1 = Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l)))) t_2 = Float64(Float64(-1.0 * t_0) / h) tmp = 0.0 if (t_1 <= -2e-162) tmp = t_2; elseif (t_1 <= Inf) tmp = Float64(t_0 / h); else tmp = t_2; end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = d * sqrt((h / l)); t_1 = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l))); t_2 = (-1.0 * t_0) / h; tmp = 0.0; if (t_1 <= -2e-162) tmp = t_2; elseif (t_1 <= Inf) tmp = t_0 / h; else tmp = t_2; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 * t$95$0), $MachinePrecision] / h), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-162], t$95$2, If[LessEqual[t$95$1, Infinity], N[(t$95$0 / h), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_0 := d \cdot \sqrt{\frac{h}{\ell}}\\
t_1 := \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_2 := \frac{-1 \cdot t\_0}{h}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-162}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < -1.9999999999999999e-162 or +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6413.6%
Applied rewrites13.6%
if -1.9999999999999999e-162 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))) (pow.f64 (/.f64 d l) (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))) (-.f64 #s(literal 1 binary64) (*.f64 (*.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)) (pow.f64 (/.f64 (*.f64 M D) (*.f64 #s(literal 2 binary64) d)) #s(literal 2 binary64))) (/.f64 h l)))) < +inf.0Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
(FPCore (d h l M D) :precision binary64 (if (<= (* (fabs M) (fabs D)) 1.9e+194) (/ (* d (sqrt (/ h l))) h) (/ (/ (* d (sqrt (* h l))) l) h)))
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((fabs(M) * fabs(D)) <= 1.9e+194) {
tmp = (d * sqrt((h / l))) / h;
} else {
tmp = ((d * sqrt((h * l))) / l) / h;
}
return tmp;
}
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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: tmp
if ((abs(m) * abs(d_1)) <= 1.9d+194) then
tmp = (d * sqrt((h / l))) / h
else
tmp = ((d * sqrt((h * l))) / l) / h
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double tmp;
if ((Math.abs(M) * Math.abs(D)) <= 1.9e+194) {
tmp = (d * Math.sqrt((h / l))) / h;
} else {
tmp = ((d * Math.sqrt((h * l))) / l) / h;
}
return tmp;
}
def code(d, h, l, M, D): tmp = 0 if (math.fabs(M) * math.fabs(D)) <= 1.9e+194: tmp = (d * math.sqrt((h / l))) / h else: tmp = ((d * math.sqrt((h * l))) / l) / h return tmp
function code(d, h, l, M, D) tmp = 0.0 if (Float64(abs(M) * abs(D)) <= 1.9e+194) tmp = Float64(Float64(d * sqrt(Float64(h / l))) / h); else tmp = Float64(Float64(Float64(d * sqrt(Float64(h * l))) / l) / h); end return tmp end
function tmp_2 = code(d, h, l, M, D) tmp = 0.0; if ((abs(M) * abs(D)) <= 1.9e+194) tmp = (d * sqrt((h / l))) / h; else tmp = ((d * sqrt((h * l))) / l) / h; end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := If[LessEqual[N[(N[Abs[M], $MachinePrecision] * N[Abs[D], $MachinePrecision]), $MachinePrecision], 1.9e+194], N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision], N[(N[(N[(d * N[Sqrt[N[(h * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / h), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|M\right| \cdot \left|D\right| \leq 1.9 \cdot 10^{+194}:\\
\;\;\;\;\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{d \cdot \sqrt{h \cdot \ell}}{\ell}}{h}\\
\end{array}
if (*.f64 M D) < 1.8999999999999999e194Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
if 1.8999999999999999e194 < (*.f64 M D) Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
Taylor expanded in l around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f6419.7%
Applied rewrites19.7%
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (sqrt (/ h l))))
(if (<= (* (fabs M) (fabs D)) 5.8e+194)
(/ (* d t_0) h)
(/ (fabs d) (* l t_0)))))double code(double d, double h, double l, double M, double D) {
double t_0 = sqrt((h / l));
double tmp;
if ((fabs(M) * fabs(D)) <= 5.8e+194) {
tmp = (d * t_0) / h;
} else {
tmp = fabs(d) / (l * t_0);
}
return tmp;
}
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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((h / l))
if ((abs(m) * abs(d_1)) <= 5.8d+194) then
tmp = (d * t_0) / h
else
tmp = abs(d) / (l * t_0)
end if
code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
double t_0 = Math.sqrt((h / l));
double tmp;
if ((Math.abs(M) * Math.abs(D)) <= 5.8e+194) {
tmp = (d * t_0) / h;
} else {
tmp = Math.abs(d) / (l * t_0);
}
return tmp;
}
def code(d, h, l, M, D): t_0 = math.sqrt((h / l)) tmp = 0 if (math.fabs(M) * math.fabs(D)) <= 5.8e+194: tmp = (d * t_0) / h else: tmp = math.fabs(d) / (l * t_0) return tmp
function code(d, h, l, M, D) t_0 = sqrt(Float64(h / l)) tmp = 0.0 if (Float64(abs(M) * abs(D)) <= 5.8e+194) tmp = Float64(Float64(d * t_0) / h); else tmp = Float64(abs(d) / Float64(l * t_0)); end return tmp end
function tmp_2 = code(d, h, l, M, D) t_0 = sqrt((h / l)); tmp = 0.0; if ((abs(M) * abs(D)) <= 5.8e+194) tmp = (d * t_0) / h; else tmp = abs(d) / (l * t_0); end tmp_2 = tmp; end
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Abs[M], $MachinePrecision] * N[Abs[D], $MachinePrecision]), $MachinePrecision], 5.8e+194], N[(N[(d * t$95$0), $MachinePrecision] / h), $MachinePrecision], N[(N[Abs[d], $MachinePrecision] / N[(l * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \sqrt{\frac{h}{\ell}}\\
\mathbf{if}\;\left|M\right| \cdot \left|D\right| \leq 5.8 \cdot 10^{+194}:\\
\;\;\;\;\frac{d \cdot t\_0}{h}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|d\right|}{\ell \cdot t\_0}\\
\end{array}
if (*.f64 M D) < 5.8000000000000001e194Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
if 5.8000000000000001e194 < (*.f64 M D) Initial program 66.7%
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lift-/.f64N/A
frac-2negN/A
associate-*r/N/A
sqrt-divN/A
lower-unsound-/.f64N/A
lower-unsound-sqrt.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-unsound-sqrt.f64N/A
lower-neg.f6424.2%
Applied rewrites24.2%
Applied rewrites49.8%
Taylor expanded in l around inf
lower-/.f64N/A
lower-fabs.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.1%
Applied rewrites24.1%
(FPCore (d h l M D) :precision binary64 (/ (* d (sqrt (/ h l))) h))
double code(double d, double h, double l, double M, double D) {
return (d * sqrt((h / l))) / h;
}
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(d, h, l, m, d_1)
use fmin_fmax_functions
real(8), intent (in) :: d
real(8), intent (in) :: h
real(8), intent (in) :: l
real(8), intent (in) :: m
real(8), intent (in) :: d_1
code = (d * sqrt((h / l))) / h
end function
public static double code(double d, double h, double l, double M, double D) {
return (d * Math.sqrt((h / l))) / h;
}
def code(d, h, l, M, D): return (d * math.sqrt((h / l))) / h
function code(d, h, l, M, D) return Float64(Float64(d * sqrt(Float64(h / l))) / h) end
function tmp = code(d, h, l, M, D) tmp = (d * sqrt((h / l))) / h; end
code[d_, h_, l_, M_, D_] := N[(N[(d * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]
\frac{d \cdot \sqrt{\frac{h}{\ell}}}{h}
Initial program 66.7%
Taylor expanded in h around 0
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6424.3%
Applied rewrites24.3%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
sqrt-unprodN/A
lower-sqrt.f64N/A
lower-*.f6422.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.2%
Applied rewrites22.2%
Taylor expanded in d around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f6437.5%
Applied rewrites37.5%
herbie shell --seed 2025202
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))