
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (* x (/ 1.0 (tan B))))))
(if (<= F -6e+35)
(- (* -1.0 (/ (* x (cos B)) (sin B))) t_0)
(if (<= F 21000000.0)
(+
t_1
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(+ t_1 t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -6e+35) {
tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0;
} else if (F <= 21000000.0) {
tmp = t_1 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_1 + 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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 / sin(b)
t_1 = -(x * (1.0d0 / tan(b)))
if (f <= (-6d+35)) then
tmp = ((-1.0d0) * ((x * cos(b)) / sin(b))) - t_0
else if (f <= 21000000.0d0) then
tmp = t_1 + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = t_1 + t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = -(x * (1.0 / Math.tan(B)));
double tmp;
if (F <= -6e+35) {
tmp = (-1.0 * ((x * Math.cos(B)) / Math.sin(B))) - t_0;
} else if (F <= 21000000.0) {
tmp = t_1 + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_1 + t_0;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = -(x * (1.0 / math.tan(B))) tmp = 0 if F <= -6e+35: tmp = (-1.0 * ((x * math.cos(B)) / math.sin(B))) - t_0 elif F <= 21000000.0: tmp = t_1 + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = t_1 + t_0 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -6e+35) tmp = Float64(Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) - t_0); elseif (F <= 21000000.0) tmp = Float64(t_1 + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(t_1 + t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = -(x * (1.0 / tan(B))); tmp = 0.0; if (F <= -6e+35) tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0; elseif (F <= 21000000.0) tmp = t_1 + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = t_1 + t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -6e+35], N[(N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 21000000.0], N[(t$95$1 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{+35}:\\
\;\;\;\;-1 \cdot \frac{x \cdot \cos B}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 21000000:\\
\;\;\;\;t\_1 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + t\_0\\
\end{array}
\end{array}
if F < -5.99999999999999981e35Initial program 77.7%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-/.f6455.8
Applied rewrites55.8%
if -5.99999999999999981e35 < F < 2.1e7Initial program 77.7%
if 2.1e7 < F Initial program 77.7%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (* x (/ 1.0 (tan B))))))
(if (<= F -1.45)
(- (* -1.0 (/ (* x (cos B)) (sin B))) t_0)
(if (<= F 1.4)
(+ t_1 (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* 2.0 x))))))
(+ t_1 t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -1.45) {
tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0;
} else if (F <= 1.4) {
tmp = t_1 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (2.0 * x)))));
} else {
tmp = t_1 + 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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 / sin(b)
t_1 = -(x * (1.0d0 / tan(b)))
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) * ((x * cos(b)) / sin(b))) - t_0
else if (f <= 1.4d0) then
tmp = t_1 + ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (2.0d0 * x)))))
else
tmp = t_1 + t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = -(x * (1.0 / Math.tan(B)));
double tmp;
if (F <= -1.45) {
tmp = (-1.0 * ((x * Math.cos(B)) / Math.sin(B))) - t_0;
} else if (F <= 1.4) {
tmp = t_1 + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (2.0 * x)))));
} else {
tmp = t_1 + t_0;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = -(x * (1.0 / math.tan(B))) tmp = 0 if F <= -1.45: tmp = (-1.0 * ((x * math.cos(B)) / math.sin(B))) - t_0 elif F <= 1.4: tmp = t_1 + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (2.0 * x))))) else: tmp = t_1 + t_0 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) - t_0); elseif (F <= 1.4) tmp = Float64(t_1 + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x)))))); else tmp = Float64(t_1 + t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = -(x * (1.0 / tan(B))); tmp = 0.0; if (F <= -1.45) tmp = (-1.0 * ((x * cos(B)) / sin(B))) - t_0; elseif (F <= 1.4) tmp = t_1 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (2.0 * x))))); else tmp = t_1 + t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -1.45], N[(N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$1 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;-1 \cdot \frac{x \cdot \cos B}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_1 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + t\_0\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 77.7%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-/.f6455.8
Applied rewrites55.8%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 77.7%
Taylor expanded in F around 0
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-*.f6455.8
Applied rewrites55.8%
if 1.3999999999999999 < F Initial program 77.7%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -1.45)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 1.4)
(+ t_0 (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* 2.0 x))))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -1.45) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 1.4) {
tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (2.0 * x)))));
} else {
tmp = t_0 + (1.0 / sin(B));
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -(x * (1.0d0 / tan(b)))
if (f <= (-1.45d0)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 1.4d0) then
tmp = t_0 + ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (2.0d0 * x)))))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / Math.tan(B)));
double tmp;
if (F <= -1.45) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 1.4) {
tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (2.0 * x)))));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = -(x * (1.0 / math.tan(B))) tmp = 0 if F <= -1.45: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 1.4: tmp = t_0 + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (2.0 * x))))) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -1.45) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 1.4) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x)))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x * (1.0 / tan(B))); tmp = 0.0; if (F <= -1.45) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 1.4) tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / (2.0 + (2.0 * x))))); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -1.45], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.7
Applied rewrites55.7%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 77.7%
Taylor expanded in F around 0
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-*.f6455.8
Applied rewrites55.8%
if 1.3999999999999999 < F Initial program 77.7%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -3.8e+21)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 190000.0)
(+ t_0 (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (fma 2.0 x (pow F 2.0)))))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -3.8e+21) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 190000.0) {
tmp = t_0 + ((F / B) * sqrt((1.0 / (2.0 + fma(2.0, x, pow(F, 2.0))))));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -3.8e+21) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 190000.0) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + fma(2.0, x, (F ^ 2.0))))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -3.8e+21], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 190000.0], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -3.8 \cdot 10^{+21}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 190000:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.8e21Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.7
Applied rewrites55.7%
if -3.8e21 < F < 1.9e5Initial program 77.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6462.8
Applied rewrites62.8%
if 1.9e5 < F Initial program 77.7%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -3.8e+21)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 3.8e+52)
(+ t_0 (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (fma 2.0 x (pow F 2.0)))))))
(+ (- (* x (/ 1.0 B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -3.8e+21) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 3.8e+52) {
tmp = t_0 + ((F / B) * sqrt((1.0 / (2.0 + fma(2.0, x, pow(F, 2.0))))));
} else {
tmp = -(x * (1.0 / B)) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -3.8e+21) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 3.8e+52) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + fma(2.0, x, (F ^ 2.0))))))); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -3.8e+21], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e+52], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -3.8 \cdot 10^{+21}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{+52}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.8e21Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.7
Applied rewrites55.7%
if -3.8e21 < F < 3.8e52Initial program 77.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6462.8
Applied rewrites62.8%
if 3.8e52 < F Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites50.1%
Taylor expanded in F around inf
lift-sin.f64N/A
lift-/.f6436.3
Applied rewrites36.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -4e+22)
(* -1.0 (+ t_0 (/ x (sin B))))
(if (<= F 3.8e+52)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F B) (sqrt (/ 1.0 (+ 2.0 (fma 2.0 x (pow F 2.0)))))))
(+ (- (* x (/ 1.0 B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -4e+22) {
tmp = -1.0 * (t_0 + (x / sin(B)));
} else if (F <= 3.8e+52) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + fma(2.0, x, pow(F, 2.0))))));
} else {
tmp = -(x * (1.0 / B)) + t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -4e+22) tmp = Float64(-1.0 * Float64(t_0 + Float64(x / sin(B)))); elseif (F <= 3.8e+52) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + fma(2.0, x, (F ^ 2.0))))))); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / B))) + t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+22], N[(-1.0 * N[(t$95$0 + N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e+52], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]) + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+22}:\\
\;\;\;\;-1 \cdot \left(t\_0 + \frac{x}{\sin B}\right)\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{+52}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{B}\right) + t\_0\\
\end{array}
\end{array}
if F < -4e22Initial program 77.7%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
Taylor expanded in B around 0
Applied rewrites37.8%
if -4e22 < F < 3.8e52Initial program 77.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6462.8
Applied rewrites62.8%
if 3.8e52 < F Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites50.1%
Taylor expanded in F around inf
lift-sin.f64N/A
lift-/.f6436.3
Applied rewrites36.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ (* x (cos B)) (sin B)))))
(if (<= x -0.00039)
t_0
(if (<= x 8.5e-84)
(+
(- (/ x B))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
t_0))))
double code(double F, double B, double x) {
double t_0 = -1.0 * ((x * cos(B)) / sin(B));
double tmp;
if (x <= -0.00039) {
tmp = t_0;
} else if (x <= 8.5e-84) {
tmp = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = 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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) * ((x * cos(b)) / sin(b))
if (x <= (-0.00039d0)) then
tmp = t_0
else if (x <= 8.5d-84) then
tmp = -(x / b) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 * ((x * Math.cos(B)) / Math.sin(B));
double tmp;
if (x <= -0.00039) {
tmp = t_0;
} else if (x <= 8.5e-84) {
tmp = -(x / B) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 * ((x * math.cos(B)) / math.sin(B)) tmp = 0 if x <= -0.00039: tmp = t_0 elif x <= 8.5e-84: tmp = -(x / B) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) tmp = 0.0 if (x <= -0.00039) tmp = t_0; elseif (x <= 8.5e-84) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 * ((x * cos(B)) / sin(B)); tmp = 0.0; if (x <= -0.00039) tmp = t_0; elseif (x <= 8.5e-84) tmp = -(x / B) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00039], t$95$0, If[LessEqual[x, 8.5e-84], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{if}\;x \leq -0.00039:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-84}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.89999999999999993e-4 or 8.4999999999999994e-84 < x Initial program 77.7%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6457.1
Applied rewrites57.1%
if -3.89999999999999993e-4 < x < 8.4999999999999994e-84Initial program 77.7%
Taylor expanded in B around 0
lower-/.f6450.2
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ (* x (cos B)) (sin B)))))
(if (<= x -9.5e-60)
t_0
(if (<= x 8.2e-84)
(* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (pow F 2.0)))))
t_0))))
double code(double F, double B, double x) {
double t_0 = -1.0 * ((x * cos(B)) / sin(B));
double tmp;
if (x <= -9.5e-60) {
tmp = t_0;
} else if (x <= 8.2e-84) {
tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + pow(F, 2.0))));
} else {
tmp = 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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) * ((x * cos(b)) / sin(b))
if (x <= (-9.5d-60)) then
tmp = t_0
else if (x <= 8.2d-84) then
tmp = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (f ** 2.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 * ((x * Math.cos(B)) / Math.sin(B));
double tmp;
if (x <= -9.5e-60) {
tmp = t_0;
} else if (x <= 8.2e-84) {
tmp = (F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + Math.pow(F, 2.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 * ((x * math.cos(B)) / math.sin(B)) tmp = 0 if x <= -9.5e-60: tmp = t_0 elif x <= 8.2e-84: tmp = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + math.pow(F, 2.0)))) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) tmp = 0.0 if (x <= -9.5e-60) tmp = t_0; elseif (x <= 8.2e-84) tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + (F ^ 2.0))))); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 * ((x * cos(B)) / sin(B)); tmp = 0.0; if (x <= -9.5e-60) tmp = t_0; elseif (x <= 8.2e-84) tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (F ^ 2.0)))); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e-60], t$95$0, If[LessEqual[x, 8.2e-84], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{-60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -9.49999999999999958e-60 or 8.2000000000000001e-84 < x Initial program 77.7%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6457.1
Applied rewrites57.1%
if -9.49999999999999958e-60 < x < 8.2000000000000001e-84Initial program 77.7%
Taylor expanded in x around 0
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-pow.f6429.4
Applied rewrites29.4%
(FPCore (F B x) :precision binary64 (if (<= B 58.0) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (fma 2.0 x (pow F 2.0)))))) x) B) (+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 58.0) {
tmp = ((F * sqrt((1.0 / (2.0 + fma(2.0, x, pow(F, 2.0)))))) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * (-1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 58.0) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + fma(2.0, x, (F ^ 2.0)))))) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 58.0], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 58:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if B < 58Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
if 58 < B Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f6447.7
Applied rewrites47.7%
Taylor expanded in B around 0
lower-/.f6447.2
Applied rewrites47.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 B)))))
(if (<= F -8e-20)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 190000.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (fma 2.0 x (pow F 2.0)))))) x) B)
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / B));
double tmp;
if (F <= -8e-20) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 190000.0) {
tmp = ((F * sqrt((1.0 / (2.0 + fma(2.0, x, pow(F, 2.0)))))) - x) / B;
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / B))) tmp = 0.0 if (F <= -8e-20) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 190000.0) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + fma(2.0, x, (F ^ 2.0)))))) - x) / B); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -8e-20], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 190000.0], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{-20}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 190000:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -7.99999999999999956e-20Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6436.3
Applied rewrites36.3%
if -7.99999999999999956e-20 < F < 1.9e5Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
if 1.9e5 < F Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites50.1%
Taylor expanded in F around inf
lift-sin.f64N/A
lift-/.f6436.3
Applied rewrites36.3%
(FPCore (F B x)
:precision binary64
(if (<= F -8e-20)
(+ (- (* x (/ 1.0 B))) (/ -1.0 (sin B)))
(if (<= F 29000000.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (fma 2.0 x (pow F 2.0)))))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e-20) {
tmp = -(x * (1.0 / B)) + (-1.0 / sin(B));
} else if (F <= 29000000.0) {
tmp = ((F * sqrt((1.0 / (2.0 + fma(2.0, x, pow(F, 2.0)))))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8e-20) tmp = Float64(Float64(-Float64(x * Float64(1.0 / B))) + Float64(-1.0 / sin(B))); elseif (F <= 29000000.0) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + fma(2.0, x, (F ^ 2.0)))))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8e-20], N[((-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 29000000.0], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{-20}:\\
\;\;\;\;\left(-x \cdot \frac{1}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 29000000:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.99999999999999956e-20Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6436.3
Applied rewrites36.3%
if -7.99999999999999956e-20 < F < 2.9e7Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
if 2.9e7 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x)
:precision binary64
(if (<= F -0.47)
(/ (- (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (pow F 2.0))) 1.0) x) B)
(if (<= F 29000000.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (fma 2.0 x (pow F 2.0)))))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.47) {
tmp = (((0.5 * ((2.0 + (2.0 * x)) / pow(F, 2.0))) - 1.0) - x) / B;
} else if (F <= 29000000.0) {
tmp = ((F * sqrt((1.0 / (2.0 + fma(2.0, x, pow(F, 2.0)))))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.47) tmp = Float64(Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / (F ^ 2.0))) - 1.0) - x) / B); elseif (F <= 29000000.0) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + fma(2.0, x, (F ^ 2.0)))))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.47], N[(N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 29000000.0], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.47:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 29000000:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \mathsf{fma}\left(2, x, {F}^{2}\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.46999999999999997Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lift-*.f64N/A
lift-pow.f6422.0
Applied rewrites22.0%
if -0.46999999999999997 < F < 2.9e7Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
if 2.9e7 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ 2.0 (* 2.0 x))))
(if (<= F -0.47)
(/ (- (- (* 0.5 (/ t_0 (pow F 2.0))) 1.0) x) B)
(if (<= F 1.4)
(fma -1.0 (/ x B) (* F (* (/ 1.0 B) (sqrt (/ 1.0 t_0)))))
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double t_0 = 2.0 + (2.0 * x);
double tmp;
if (F <= -0.47) {
tmp = (((0.5 * (t_0 / pow(F, 2.0))) - 1.0) - x) / B;
} else if (F <= 1.4) {
tmp = fma(-1.0, (x / B), (F * ((1.0 / B) * sqrt((1.0 / t_0)))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(2.0 + Float64(2.0 * x)) tmp = 0.0 if (F <= -0.47) tmp = Float64(Float64(Float64(Float64(0.5 * Float64(t_0 / (F ^ 2.0))) - 1.0) - x) / B); elseif (F <= 1.4) tmp = fma(-1.0, Float64(x / B), Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / t_0))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.47], N[(N[(N[(N[(0.5 * N[(t$95$0 / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4], N[(-1.0 * N[(x / B), $MachinePrecision] + N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + 2 \cdot x\\
\mathbf{if}\;F \leq -0.47:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{t\_0}{{F}^{2}} - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{x}{B}, F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{t\_0}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.46999999999999997Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lift-*.f64N/A
lift-pow.f6422.0
Applied rewrites22.0%
if -0.46999999999999997 < F < 1.3999999999999999Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites25.5%
Taylor expanded in F around 0
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-*.f6429.7
Applied rewrites29.7%
if 1.3999999999999999 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45)
(/ (- -1.0 x) B)
(if (<= F 1.4)
(fma -1.0 (/ x B) (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* 2.0 x)))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4) {
tmp = fma(-1.0, (x / B), (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (2.0 * x)))))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4) tmp = fma(-1.0, Float64(x / B), Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x))))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.45], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4], N[(-1.0 * N[(x / B), $MachinePrecision] + N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{x}{B}, F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
Applied rewrites25.5%
Taylor expanded in F around 0
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-*.f6429.7
Applied rewrites29.7%
if 1.3999999999999999 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45)
(/ (- -1.0 x) B)
(if (<= F 1.4)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* 2.0 x))))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4) {
tmp = ((F * sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.4d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (2.0d0 * x))))) - x) / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.45) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45: tmp = (-1.0 - x) / B elif F <= 1.4: tmp = ((F * math.sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(2.0 * x))))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.45) tmp = (-1.0 - x) / B; elseif (F <= 1.4) tmp = ((F * sqrt((1.0 / (2.0 + (2.0 * x))))) - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around 0
lift-*.f6430.1
Applied rewrites30.1%
if 1.3999999999999999 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-50)
(/ (- -1.0 x) B)
(if (<= F 8.8e-70)
(/ (* -1.0 x) B)
(if (<= F 0.6) (* (/ F B) (sqrt 0.5)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-50) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.8e-70) {
tmp = (-1.0 * x) / B;
} else if (F <= 0.6) {
tmp = (F / B) * sqrt(0.5);
} else {
tmp = (1.0 - x) / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-7d-50)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8.8d-70) then
tmp = ((-1.0d0) * x) / b
else if (f <= 0.6d0) then
tmp = (f / b) * sqrt(0.5d0)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7e-50) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.8e-70) {
tmp = (-1.0 * x) / B;
} else if (F <= 0.6) {
tmp = (F / B) * Math.sqrt(0.5);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7e-50: tmp = (-1.0 - x) / B elif F <= 8.8e-70: tmp = (-1.0 * x) / B elif F <= 0.6: tmp = (F / B) * math.sqrt(0.5) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7e-50) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.8e-70) tmp = Float64(Float64(-1.0 * x) / B); elseif (F <= 0.6) tmp = Float64(Float64(F / B) * sqrt(0.5)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7e-50) tmp = (-1.0 - x) / B; elseif (F <= 8.8e-70) tmp = (-1.0 * x) / B; elseif (F <= 0.6) tmp = (F / B) * sqrt(0.5); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-70], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.6], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-70}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{elif}\;F \leq 0.6:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.99999999999999993e-50Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
if -6.99999999999999993e-50 < F < 8.7999999999999996e-70Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around 0
lower-*.f6430.2
Applied rewrites30.2%
if 8.7999999999999996e-70 < F < 0.599999999999999978Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-pow.f6415.1
Applied rewrites15.1%
Taylor expanded in F around 0
Applied rewrites12.5%
if 0.599999999999999978 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-50)
(/ (- -1.0 x) B)
(if (<= F 8.8e-70)
(/ (* -1.0 x) B)
(if (<= F 0.6) (/ (* F (sqrt 0.5)) B) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-50) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.8e-70) {
tmp = (-1.0 * x) / B;
} else if (F <= 0.6) {
tmp = (F * sqrt(0.5)) / B;
} else {
tmp = (1.0 - x) / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-7d-50)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8.8d-70) then
tmp = ((-1.0d0) * x) / b
else if (f <= 0.6d0) then
tmp = (f * sqrt(0.5d0)) / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7e-50) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.8e-70) {
tmp = (-1.0 * x) / B;
} else if (F <= 0.6) {
tmp = (F * Math.sqrt(0.5)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7e-50: tmp = (-1.0 - x) / B elif F <= 8.8e-70: tmp = (-1.0 * x) / B elif F <= 0.6: tmp = (F * math.sqrt(0.5)) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7e-50) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.8e-70) tmp = Float64(Float64(-1.0 * x) / B); elseif (F <= 0.6) tmp = Float64(Float64(F * sqrt(0.5)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7e-50) tmp = (-1.0 - x) / B; elseif (F <= 8.8e-70) tmp = (-1.0 * x) / B; elseif (F <= 0.6) tmp = (F * sqrt(0.5)) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-70], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.6], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-70}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{elif}\;F \leq 0.6:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.99999999999999993e-50Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
if -6.99999999999999993e-50 < F < 8.7999999999999996e-70Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around 0
lower-*.f6430.2
Applied rewrites30.2%
if 8.7999999999999996e-70 < F < 0.599999999999999978Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-pow.f6415.1
Applied rewrites15.1%
Taylor expanded in F around 0
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
metadata-eval12.5
Applied rewrites12.5%
if 0.599999999999999978 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x) :precision binary64 (if (<= F -7e-50) (/ (- -1.0 x) B) (if (<= F 7e-153) (/ (* -1.0 x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-50) {
tmp = (-1.0 - x) / B;
} else if (F <= 7e-153) {
tmp = (-1.0 * x) / B;
} else {
tmp = (1.0 - x) / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-7d-50)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7d-153) then
tmp = ((-1.0d0) * x) / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7e-50) {
tmp = (-1.0 - x) / B;
} else if (F <= 7e-153) {
tmp = (-1.0 * x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7e-50: tmp = (-1.0 - x) / B elif F <= 7e-153: tmp = (-1.0 * x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7e-50) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7e-153) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7e-50) tmp = (-1.0 - x) / B; elseif (F <= 7e-153) tmp = (-1.0 * x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7e-50], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-153], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-153}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.99999999999999993e-50Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
if -6.99999999999999993e-50 < F < 6.99999999999999961e-153Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around 0
lower-*.f6430.2
Applied rewrites30.2%
if 6.99999999999999961e-153 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x) :precision binary64 (if (<= F 6.4e-236) (/ (- -1.0 x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 6.4e-236) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 6.4d-236) then
tmp = ((-1.0d0) - x) / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 6.4e-236) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 6.4e-236: tmp = (-1.0 - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 6.4e-236) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 6.4e-236) tmp = (-1.0 - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 6.4e-236], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6.4 \cdot 10^{-236}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 6.3999999999999999e-236Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
if 6.3999999999999999e-236 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around inf
Applied rewrites29.7%
(FPCore (F B x) :precision binary64 (/ (- -1.0 x) B))
double code(double F, double B, double x) {
return (-1.0 - x) / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = ((-1.0d0) - x) / b
end function
public static double code(double F, double B, double x) {
return (-1.0 - x) / B;
}
def code(F, B, x): return (-1.0 - x) / B
function code(F, B, x) return Float64(Float64(-1.0 - x) / B) end
function tmp = code(F, B, x) tmp = (-1.0 - x) / B; end
code[F_, B_, x_] := N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1 - x}{B}
\end{array}
Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
(FPCore (F B x) :precision binary64 (if (<= F 8.2e-77) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 8.2e-77) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 8.2d-77) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 8.2e-77) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 8.2e-77: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 8.2e-77) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 8.2e-77) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 8.2e-77], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 8.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 8.19999999999999925e-77Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-pow.f6415.1
Applied rewrites15.1%
Taylor expanded in F around -inf
lower-/.f6410.2
Applied rewrites10.2%
if 8.19999999999999925e-77 < F Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-pow.f6415.1
Applied rewrites15.1%
Taylor expanded in F around inf
lift-/.f649.4
Applied rewrites9.4%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
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(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 77.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.2
Applied rewrites44.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-pow.f6415.1
Applied rewrites15.1%
Taylor expanded in F around -inf
lower-/.f6410.2
Applied rewrites10.2%
herbie shell --seed 2025132
(FPCore (F B x)
:name "VandenBroeck and Keller, Equation (23)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))