
(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]
\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)}
Herbie found 24 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]
\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)}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+79)
(/ (fma (/ -1.0 F) F (* (sin B) (/ (- x) (tan B)))) (sin B))
(if (<= F 5000.0)
(- (/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4e+79) {
tmp = fma((-1.0 / F), F, (sin(B) * (-x / tan(B)))) / sin(B);
} else if (F <= 5000.0) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4e+79) tmp = Float64(fma(Float64(-1.0 / F), F, Float64(sin(B) * Float64(Float64(-x) / tan(B)))) / sin(B)); elseif (F <= 5000.0) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+79], N[(N[(N[(-1.0 / F), $MachinePrecision] * F + N[(N[Sin[B], $MachinePrecision] * N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5000.0], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+79}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{F}, F, \sin B \cdot \frac{-x}{\tan B}\right)}{\sin B}\\
\mathbf{elif}\;F \leq 5000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -3.9999999999999999e79Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in F around -inf
lower-/.f6456.1%
Applied rewrites56.1%
if -3.9999999999999999e79 < F < 5e3Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
if 5e3 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.45e+154)
(- (* F (/ -1.0 (* F (sin B)))) t_0)
(if (<= F 5000.0)
(- (/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.45e+154) {
tmp = (F * (-1.0 / (F * sin(B)))) - t_0;
} else if (F <= 5000.0) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.45e+154) tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * sin(B)))) - t_0); elseif (F <= 5000.0) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.45e+154], N[(N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5000.0], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.45 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t\_0\\
\mathbf{elif}\;F \leq 5000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -2.4500000000000001e154Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.4%
Applied rewrites85.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6455.0%
Applied rewrites55.0%
if -2.4500000000000001e154 < F < 5e3Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
if 5e3 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -410.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.2e-10)
(- (/ (* (pow (fma 2.0 x 2.0) -0.5) F) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -410.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.2e-10) {
tmp = ((pow(fma(2.0, x, 2.0), -0.5) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -410.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.2e-10) tmp = Float64(Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -410.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.2e-10], N[(N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -410:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -410Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around -inf
Applied rewrites56.2%
if -410 < F < 3.1999999999999998e-10Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around 0
Applied rewrites56.2%
if 3.1999999999999998e-10 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -410.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.2e-10)
(/ (fma (pow (fma 2.0 x 2.0) -0.5) F (* (cos B) (- x))) (sin B))
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -410.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.2e-10) {
tmp = fma(pow(fma(2.0, x, 2.0), -0.5), F, (cos(B) * -x)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -410.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.2e-10) tmp = Float64(fma((fma(2.0, x, 2.0) ^ -0.5), F, Float64(cos(B) * Float64(-x))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -410.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.2e-10], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -410:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}, F, \cos B \cdot \left(-x\right)\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -410Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around -inf
Applied rewrites56.2%
if -410 < F < 3.1999999999999998e-10Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in F around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f6456.5%
Applied rewrites56.5%
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.5%
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f6456.5%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6456.5%
Applied rewrites56.5%
if 3.1999999999999998e-10 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -410.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.1e-9)
(/ (fma -1.0 (* x (cos B)) (* F (pow 2.0 -0.5))) (sin B))
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -410.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.1e-9) {
tmp = fma(-1.0, (x * cos(B)), (F * pow(2.0, -0.5))) / sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -410.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.1e-9) tmp = Float64(fma(-1.0, Float64(x * cos(B)), Float64(F * (2.0 ^ -0.5))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -410.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.1e-9], N[(N[(-1.0 * N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[(F * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -410:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-9}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {2}^{-0.5}\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -410Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around -inf
Applied rewrites56.2%
if -410 < F < 2.1000000000000002e-9Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in F around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f6456.5%
Applied rewrites56.5%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval58.5%
Applied rewrites58.5%
if 2.1000000000000002e-9 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -15000000000000.0)
(- (* F (/ -1.0 (* F (sin B)))) t_1)
(if (<= F -3.7e-180)
(/ (fma t_0 F (* -1.0 x)) (sin B))
(if (<= F 4e-22) (- (/ (* t_0 F) B) t_1) (- (/ 1.0 (sin B)) t_1))))))double code(double F, double B, double x) {
double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -15000000000000.0) {
tmp = (F * (-1.0 / (F * sin(B)))) - t_1;
} else if (F <= -3.7e-180) {
tmp = fma(t_0, F, (-1.0 * x)) / sin(B);
} else if (F <= 4e-22) {
tmp = ((t_0 * F) / B) - t_1;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -15000000000000.0) tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * sin(B)))) - t_1); elseif (F <= -3.7e-180) tmp = Float64(fma(t_0, F, Float64(-1.0 * x)) / sin(B)); elseif (F <= 4e-22) tmp = Float64(Float64(Float64(t_0 * F) / B) - t_1); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -15000000000000.0], N[(N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.7e-180], N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-22], N[(N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -15000000000000:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t\_1\\
\mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-22}:\\
\;\;\;\;\frac{t\_0 \cdot F}{B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
if F < -1.5e13Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.4%
Applied rewrites85.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6455.0%
Applied rewrites55.0%
if -1.5e13 < F < -3.7000000000000002e-180Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if -3.7000000000000002e-180 < F < 4.0000000000000002e-22Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
Applied rewrites70.5%
if 4.0000000000000002e-22 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -2.1e+67)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.7e-180)
(/ (fma t_0 F (* -1.0 x)) (sin B))
(if (<= F 4e-22) (- (/ (* t_0 F) B) t_1) (- (/ 1.0 (sin B)) t_1))))))double code(double F, double B, double x) {
double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -2.1e+67) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.7e-180) {
tmp = fma(t_0, F, (-1.0 * x)) / sin(B);
} else if (F <= 4e-22) {
tmp = ((t_0 * F) / B) - t_1;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.1e+67) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.7e-180) tmp = Float64(fma(t_0, F, Float64(-1.0 * x)) / sin(B)); elseif (F <= 4e-22) tmp = Float64(Float64(Float64(t_0 * F) / B) - t_1); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.1e+67], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.7e-180], N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-22], N[(N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.1 \cdot 10^{+67}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-22}:\\
\;\;\;\;\frac{t\_0 \cdot F}{B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
if F < -2.1000000000000001e67Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around -inf
Applied rewrites56.2%
if -2.1000000000000001e67 < F < -3.7000000000000002e-180Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if -3.7000000000000002e-180 < F < 4.0000000000000002e-22Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
Applied rewrites70.5%
if 4.0000000000000002e-22 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5))
(t_1 (/ (fma t_0 F (* -1.0 x)) (sin B)))
(t_2 (/ x (tan B))))
(if (<= F -2.1e+67)
(- (/ -1.0 (sin B)) t_2)
(if (<= F -3.7e-180)
t_1
(if (<= F 5e-23)
(- (/ (* t_0 F) B) t_2)
(if (<= F 9.6e+61)
t_1
(-
(/ 1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
t_2)))))))double code(double F, double B, double x) {
double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
double t_1 = fma(t_0, F, (-1.0 * x)) / sin(B);
double t_2 = x / tan(B);
double tmp;
if (F <= -2.1e+67) {
tmp = (-1.0 / sin(B)) - t_2;
} else if (F <= -3.7e-180) {
tmp = t_1;
} else if (F <= 5e-23) {
tmp = ((t_0 * F) / B) - t_2;
} else if (F <= 9.6e+61) {
tmp = t_1;
} else {
tmp = (1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))))) - t_2;
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(fma(t_0, F, Float64(-1.0 * x)) / sin(B)) t_2 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.1e+67) tmp = Float64(Float64(-1.0 / sin(B)) - t_2); elseif (F <= -3.7e-180) tmp = t_1; elseif (F <= 5e-23) tmp = Float64(Float64(Float64(t_0 * F) / B) - t_2); elseif (F <= 9.6e+61) tmp = t_1; else tmp = Float64(Float64(1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))) - t_2); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.1e+67], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, -3.7e-180], t$95$1, If[LessEqual[F, 5e-23], N[(N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, 9.6e+61], t$95$1, N[(N[(1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_1 := \frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.1 \cdot 10^{+67}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_2\\
\mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-23}:\\
\;\;\;\;\frac{t\_0 \cdot F}{B} - t\_2\\
\mathbf{elif}\;F \leq 9.6 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - t\_2\\
\end{array}
if F < -2.1000000000000001e67Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around -inf
Applied rewrites56.2%
if -2.1000000000000001e67 < F < -3.7000000000000002e-180 or 5.0000000000000002e-23 < F < 9.5999999999999995e61Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if -3.7000000000000002e-180 < F < 5.0000000000000002e-23Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
Applied rewrites70.5%
if 9.5999999999999995e61 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6454.9%
Applied rewrites54.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5))
(t_1 (sin (fabs B)))
(t_2 (tan (fabs B)))
(t_3 (/ x t_2))
(t_4
(+
(- (* x (/ 1.0 t_2)))
(* (/ F t_1) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(t_5 (- (/ (* t_0 F) (fabs B)) t_3)))
(*
(copysign 1.0 B)
(if (<= t_4 -20000000000.0)
t_5
(if (<= t_4 10.0)
(/ (fma t_0 F (* -1.0 x)) t_1)
(if (<= t_4 2e+198)
t_5
(-
(/
1.0
(* (fabs B) (+ 1.0 (* -0.16666666666666666 (pow (fabs B) 2.0)))))
t_3)))))))double code(double F, double B, double x) {
double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
double t_1 = sin(fabs(B));
double t_2 = tan(fabs(B));
double t_3 = x / t_2;
double t_4 = -(x * (1.0 / t_2)) + ((F / t_1) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
double t_5 = ((t_0 * F) / fabs(B)) - t_3;
double tmp;
if (t_4 <= -20000000000.0) {
tmp = t_5;
} else if (t_4 <= 10.0) {
tmp = fma(t_0, F, (-1.0 * x)) / t_1;
} else if (t_4 <= 2e+198) {
tmp = t_5;
} else {
tmp = (1.0 / (fabs(B) * (1.0 + (-0.16666666666666666 * pow(fabs(B), 2.0))))) - t_3;
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5 t_1 = sin(abs(B)) t_2 = tan(abs(B)) t_3 = Float64(x / t_2) t_4 = Float64(Float64(-Float64(x * Float64(1.0 / t_2))) + Float64(Float64(F / t_1) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) t_5 = Float64(Float64(Float64(t_0 * F) / abs(B)) - t_3) tmp = 0.0 if (t_4 <= -20000000000.0) tmp = t_5; elseif (t_4 <= 10.0) tmp = Float64(fma(t_0, F, Float64(-1.0 * x)) / t_1); elseif (t_4 <= 2e+198) tmp = t_5; else tmp = Float64(Float64(1.0 / Float64(abs(B) * Float64(1.0 + Float64(-0.16666666666666666 * (abs(B) ^ 2.0))))) - t_3); end return Float64(copysign(1.0, B) * tmp) end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[B], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(x / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[((-N[(x * N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / t$95$1), $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]}, Block[{t$95$5 = N[(N[(N[(t$95$0 * F), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -20000000000.0], t$95$5, If[LessEqual[t$95$4, 10.0], N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 2e+198], t$95$5, N[(N[(1.0 / N[(N[Abs[B], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Power[N[Abs[B], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]]]]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_1 := \sin \left(\left|B\right|\right)\\
t_2 := \tan \left(\left|B\right|\right)\\
t_3 := \frac{x}{t\_2}\\
t_4 := \left(-x \cdot \frac{1}{t\_2}\right) + \frac{F}{t\_1} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
t_5 := \frac{t\_0 \cdot F}{\left|B\right|} - t\_3\\
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq -20000000000:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq 10:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{t\_1}\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+198}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)} - t\_3\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e10 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2e198Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
Applied rewrites70.5%
if -2e10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if 2e198 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6454.9%
Applied rewrites54.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(/ 1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
(/ x (tan B)))))
(if (<= x -3.6e-9)
t_0
(if (<= x 4e-70)
(/ (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (* -1.0 x)) (sin B))
t_0))))double code(double F, double B, double x) {
double t_0 = (1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))))) - (x / tan(B));
double tmp;
if (x <= -3.6e-9) {
tmp = t_0;
} else if (x <= 4e-70) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, (-1.0 * x)) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))) - Float64(x / tan(B))) tmp = 0.0 if (x <= -3.6e-9) tmp = t_0; elseif (x <= 4e-70) tmp = Float64(fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-1.0 * x)) / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e-9], t$95$0, If[LessEqual[x, 4e-70], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-70}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -1 \cdot x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -3.6e-9 or 4e-70 < x Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6454.9%
Applied rewrites54.9%
if -3.6e-9 < x < 4e-70Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
(FPCore (F B x)
:precision binary64
(if (<= F -6.6e+154)
(/ -1.0 (sin B))
(if (<= F 2.05e+131)
(/ (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (* -1.0 x)) (sin B))
(- (/ 1.0 (sin B)) (/ x B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e+154) {
tmp = -1.0 / sin(B);
} else if (F <= 2.05e+131) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, (-1.0 * x)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.6e+154) tmp = Float64(-1.0 / sin(B)); elseif (F <= 2.05e+131) tmp = Float64(fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-1.0 * x)) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.6e+154], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.05e+131], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{+131}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -1 \cdot x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
if F < -6.5999999999999997e154Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
if -6.5999999999999997e154 < F < 2.05e131Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if 2.05e131 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
Taylor expanded in B around 0
lower-/.f6435.4%
Applied rewrites35.4%
(FPCore (F B x)
:precision binary64
(if (<= F -25000000.0)
(/ -1.0 (sin B))
(if (<= F 3.2e-10)
(/ (fma -1.0 x (* F (pow (+ 2.0 (* 2.0 x)) -0.5))) (sin B))
(- (/ 1.0 (sin B)) (/ x B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -25000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 3.2e-10) {
tmp = fma(-1.0, x, (F * pow((2.0 + (2.0 * x)), -0.5))) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -25000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3.2e-10) tmp = Float64(fma(-1.0, x, Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -25000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.2e-10], N[(N[(-1.0 * x + N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -25000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, x, F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
if F < -2.5e7Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
if -2.5e7 < F < 3.1999999999999998e-10Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in F around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f6456.5%
Applied rewrites56.5%
Taylor expanded in B around 0
Applied rewrites38.3%
if 3.1999999999999998e-10 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
Taylor expanded in B around 0
lower-/.f6435.4%
Applied rewrites35.4%
(FPCore (F B x)
:precision binary64
(if (<= F -410.0)
(/ -1.0 (sin B))
(if (<= F -5.8e-121)
(/ (* F (pow 2.0 -0.5)) (sin B))
(if (<= F 4.5e-22)
(fma
(pow (fma 2.0 x (fma F F 2.0)) -0.5)
(/ F B)
(/ (- (* (* (* B B) x) 0.3333333333333333) x) B))
(- (/ 1.0 (sin B)) (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -410.0) {
tmp = -1.0 / sin(B);
} else if (F <= -5.8e-121) {
tmp = (F * pow(2.0, -0.5)) / sin(B);
} else if (F <= 4.5e-22) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / B), (((((B * B) * x) * 0.3333333333333333) - x) / B));
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -410.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= -5.8e-121) tmp = Float64(Float64(F * (2.0 ^ -0.5)) / sin(B)); elseif (F <= 4.5e-22) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / B), Float64(Float64(Float64(Float64(Float64(B * B) * x) * 0.3333333333333333) - x) / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -410.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.8e-121], N[(N[(F * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e-22], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision] + N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -410:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -5.8 \cdot 10^{-121}:\\
\;\;\;\;\frac{F \cdot {2}^{-0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{B}, \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
if F < -410Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
if -410 < F < -5.8e-121Initial program 77.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
lower-/.f64N/A
Applied rewrites85.4%
Taylor expanded in F around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f6456.5%
Applied rewrites56.5%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval20.0%
Applied rewrites20.0%
if -5.8e-121 < F < 4.4999999999999999e-22Initial program 77.2%
Taylor expanded in B around 0
lower-/.f6462.2%
Applied rewrites62.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6435.4%
Applied rewrites35.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6435.4%
Applied rewrites35.4%
if 4.4999999999999999e-22 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
Taylor expanded in B around 0
lower-/.f6435.4%
Applied rewrites35.4%
(FPCore (F B x)
:precision binary64
(if (<= F -42000000.0)
(/ -1.0 (sin B))
(if (<= F 4.5e-22)
(/ (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (- x)) B)
(- (/ 1.0 (sin B)) (/ x B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -42000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 4.5e-22) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, -x) / B;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -42000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 4.5e-22) tmp = Float64(fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -42000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e-22], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -42000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
if F < -4.2e7Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
if -4.2e7 < F < 4.4999999999999999e-22Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
lower-fma.f64N/A
Applied rewrites43.6%
if 4.4999999999999999e-22 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in F around inf
Applied rewrites55.0%
Taylor expanded in B around 0
lower-/.f6435.4%
Applied rewrites35.4%
(FPCore (F B x)
:precision binary64
(if (<= F -42000000.0)
(/ -1.0 (sin B))
(if (<= F 9.6e+54)
(/ (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (- x)) B)
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -42000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 9.6e+54) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, -x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -42000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 9.6e+54) tmp = Float64(fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-x)) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -42000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.6e+54], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -42000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 9.6 \cdot 10^{+54}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -4.2e7Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
if -4.2e7 < F < 9.5999999999999999e54Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
lower-fma.f64N/A
Applied rewrites43.6%
if 9.5999999999999999e54 < F Initial program 77.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.0%
Applied rewrites16.0%
(FPCore (F B x)
:precision binary64
(if (<= F -42000000.0)
(/ -1.0 (sin B))
(if (<= F 1.3e-11)
(/ (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (- x)) B)
(/ (- (* F (/ 1.0 F)) x) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -42000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 1.3e-11) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, -x) / B;
} else {
tmp = ((F * (1.0 / F)) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -42000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.3e-11) tmp = Float64(fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -42000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e-11], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -42000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-11}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\
\end{array}
if F < -4.2e7Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
if -4.2e7 < F < 1.3e-11Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
lower-fma.f64N/A
Applied rewrites43.6%
if 1.3e-11 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
lower-/.f6428.9%
Applied rewrites28.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.7e+154)
(/ (- (* F (/ -1.0 F)) x) B)
(if (<= F 1.3e-11)
(/ (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (- x)) B)
(/ (- (* F (/ 1.0 F)) x) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -3.7e+154) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 1.3e-11) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, -x) / B;
} else {
tmp = ((F * (1.0 / F)) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.7e+154) tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B); elseif (F <= 1.3e-11) tmp = Float64(fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.7e+154], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.3e-11], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -3.7 \cdot 10^{+154}:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-11}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\
\end{array}
if F < -3.6999999999999999e154Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around -inf
lower-/.f6429.5%
Applied rewrites29.5%
if -3.6999999999999999e154 < F < 1.3e-11Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
lower-fma.f64N/A
Applied rewrites43.6%
if 1.3e-11 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
lower-/.f6428.9%
Applied rewrites28.9%
(FPCore (F B x)
:precision binary64
(if (<= F -410.0)
(/ (- (* F (/ -1.0 F)) x) B)
(if (<= F 5000.0)
(/ (- (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) x) B)
(/ (- (* F (/ 1.0 F)) x) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -410.0) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 5000.0) {
tmp = ((F * pow((2.0 + (2.0 * x)), -0.5)) - x) / B;
} else {
tmp = ((F * (1.0 / F)) - 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 <= (-410.0d0)) then
tmp = ((f * ((-1.0d0) / f)) - x) / b
else if (f <= 5000.0d0) then
tmp = ((f * ((2.0d0 + (2.0d0 * x)) ** (-0.5d0))) - x) / b
else
tmp = ((f * (1.0d0 / f)) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -410.0) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 5000.0) {
tmp = ((F * Math.pow((2.0 + (2.0 * x)), -0.5)) - x) / B;
} else {
tmp = ((F * (1.0 / F)) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -410.0: tmp = ((F * (-1.0 / F)) - x) / B elif F <= 5000.0: tmp = ((F * math.pow((2.0 + (2.0 * x)), -0.5)) - x) / B else: tmp = ((F * (1.0 / F)) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -410.0) tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B); elseif (F <= 5000.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) - x) / B); else tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -410.0) tmp = ((F * (-1.0 / F)) - x) / B; elseif (F <= 5000.0) tmp = ((F * ((2.0 + (2.0 * x)) ^ -0.5)) - x) / B; else tmp = ((F * (1.0 / F)) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -410.0], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -410:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
\mathbf{elif}\;F \leq 5000:\\
\;\;\;\;\frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\
\end{array}
if F < -410Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around -inf
lower-/.f6429.5%
Applied rewrites29.5%
if -410 < F < 5e3Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around 0
lower-*.f6429.5%
Applied rewrites29.5%
if 5e3 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
lower-/.f6428.9%
Applied rewrites28.9%
(FPCore (F B x)
:precision binary64
(if (<= F -5.6e-55)
(/ (- (* F (/ -1.0 F)) x) B)
(if (<= F 7e-54)
(/ (* -1.0 x) B)
(/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-55) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 7e-54) {
tmp = (-1.0 * x) / B;
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.6e-55) tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B); elseif (F <= 7e-54) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.6e-55], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-54], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
if F < -5.5999999999999997e-55Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around -inf
lower-/.f6429.5%
Applied rewrites29.5%
if -5.5999999999999997e-55 < F < 6.9999999999999996e-54Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around 0
lower-*.f6429.2%
Applied rewrites29.2%
if 6.9999999999999996e-54 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0%
Applied rewrites28.0%
(FPCore (F B x) :precision binary64 (if (<= F -5.6e-55) (/ (- (* F (/ -1.0 F)) x) B) (if (<= F 7e-54) (/ (* -1.0 x) B) (/ (- (* F (/ 1.0 F)) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-55) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 7e-54) {
tmp = (-1.0 * x) / B;
} else {
tmp = ((F * (1.0 / F)) - 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 <= (-5.6d-55)) then
tmp = ((f * ((-1.0d0) / f)) - x) / b
else if (f <= 7d-54) then
tmp = ((-1.0d0) * x) / b
else
tmp = ((f * (1.0d0 / f)) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-55) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 7e-54) {
tmp = (-1.0 * x) / B;
} else {
tmp = ((F * (1.0 / F)) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.6e-55: tmp = ((F * (-1.0 / F)) - x) / B elif F <= 7e-54: tmp = (-1.0 * x) / B else: tmp = ((F * (1.0 / F)) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.6e-55) tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B); elseif (F <= 7e-54) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.6e-55) tmp = ((F * (-1.0 / F)) - x) / B; elseif (F <= 7e-54) tmp = (-1.0 * x) / B; else tmp = ((F * (1.0 / F)) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.6e-55], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-54], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\
\end{array}
if F < -5.5999999999999997e-55Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around -inf
lower-/.f6429.5%
Applied rewrites29.5%
if -5.5999999999999997e-55 < F < 6.9999999999999996e-54Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around 0
lower-*.f6429.2%
Applied rewrites29.2%
if 6.9999999999999996e-54 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
lower-/.f6428.9%
Applied rewrites28.9%
(FPCore (F B x) :precision binary64 (if (<= F -5.6e-55) (/ (- (* F (/ -1.0 F)) x) B) (if (<= F 2.5e+164) (/ (* -1.0 x) B) (/ 1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-55) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 2.5e+164) {
tmp = (-1.0 * x) / 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 <= (-5.6d-55)) then
tmp = ((f * ((-1.0d0) / f)) - x) / b
else if (f <= 2.5d+164) then
tmp = ((-1.0d0) * x) / 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 <= -5.6e-55) {
tmp = ((F * (-1.0 / F)) - x) / B;
} else if (F <= 2.5e+164) {
tmp = (-1.0 * x) / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.6e-55: tmp = ((F * (-1.0 / F)) - x) / B elif F <= 2.5e+164: tmp = (-1.0 * x) / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.6e-55) tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B); elseif (F <= 2.5e+164) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.6e-55) tmp = ((F * (-1.0 / F)) - x) / B; elseif (F <= 2.5e+164) tmp = (-1.0 * x) / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.6e-55], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e+164], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+164}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
if F < -5.5999999999999997e-55Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around -inf
lower-/.f6429.5%
Applied rewrites29.5%
if -5.5999999999999997e-55 < F < 2.4999999999999997e164Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around 0
lower-*.f6429.2%
Applied rewrites29.2%
if 2.4999999999999997e164 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
Applied rewrites9.6%
(FPCore (F B x) :precision binary64 (if (<= F 2.5e+164) (/ (* -1.0 x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.5e+164) {
tmp = (-1.0 * x) / 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 <= 2.5d+164) then
tmp = ((-1.0d0) * x) / 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 <= 2.5e+164) {
tmp = (-1.0 * x) / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.5e+164: tmp = (-1.0 * x) / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.5e+164) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2.5e+164) tmp = (-1.0 * x) / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.5e+164], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq 2.5 \cdot 10^{+164}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
if F < 2.4999999999999997e164Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around 0
lower-*.f6429.2%
Applied rewrites29.2%
if 2.4999999999999997e164 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
Applied rewrites9.6%
(FPCore (F B x) :precision binary64 (if (<= F 1.35e-111) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.35e-111) {
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 <= 1.35d-111) 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 <= 1.35e-111) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.35e-111: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.35e-111) 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 <= 1.35e-111) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.35e-111], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq 1.35 \cdot 10^{-111}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
if F < 1.3499999999999999e-111Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
Taylor expanded in B around 0
Applied rewrites10.7%
if 1.3499999999999999e-111 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2%
Applied rewrites85.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6443.6%
Applied rewrites43.6%
Taylor expanded in F around inf
Applied rewrites9.6%
(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]
\frac{-1}{B}
Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7%
Applied rewrites17.7%
Taylor expanded in B around 0
Applied rewrites10.7%
herbie shell --seed 2025205
(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))))))