
(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 23 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) (tan B))))
(if (<= F -5e+39)
(fma -1.0 t_0 t_1)
(if (<= F 5000000.0)
(/
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (* (cos B) (- x)))
(sin B))
(fma 1.0 t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -5e+39) {
tmp = fma(-1.0, t_0, t_1);
} else if (F <= 5000000.0) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, (cos(B) * -x)) / sin(B);
} else {
tmp = fma(1.0, t_0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -5e+39) tmp = fma(-1.0, t_0, t_1); elseif (F <= 5000000.0) tmp = Float64(fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(cos(B) * Float64(-x))) / sin(B)); else tmp = fma(1.0, t_0, t_1); end return 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[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+39], N[(-1.0 * t$95$0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5000000.0], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_0, t\_1\right)\\
\mathbf{elif}\;F \leq 5000000:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \cos B \cdot \left(-x\right)\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, t\_0, t\_1\right)\\
\end{array}
\end{array}
if F < -5.00000000000000015e39Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.2%
if -5.00000000000000015e39 < F < 5e6Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.6%
lift-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
sqr-powN/A
pow2N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
metadata-eval84.6
Applied rewrites84.6%
Applied rewrites76.4%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
associate-*l/N/A
div-add-revN/A
Applied rewrites84.7%
if 5e6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.42)
(fma -1.0 t_0 t_1)
(if (<= F 1.4)
(fma F (/ (pow (+ 2.0 (* 2.0 x)) -0.5) (sin B)) t_1)
(fma 1.0 t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = fma(-1.0, t_0, t_1);
} else if (F <= 1.4) {
tmp = fma(F, (pow((2.0 + (2.0 * x)), -0.5) / sin(B)), t_1);
} else {
tmp = fma(1.0, t_0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = fma(-1.0, t_0, t_1); elseif (F <= 1.4) tmp = fma(F, Float64((Float64(2.0 + Float64(2.0 * x)) ^ -0.5) / sin(B)), t_1); else tmp = fma(1.0, t_0, t_1); end return 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[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(-1.0 * t$95$0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.4], N[(F * N[(N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(1.0 * t$95$0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_0, t\_1\right)\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(2 + 2 \cdot x\right)}^{-0.5}}{\sin B}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, t\_0, t\_1\right)\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.2%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.6%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6455.5
Applied rewrites55.5%
if 1.3999999999999999 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.35)
(fma -1.0 t_0 t_1)
(if (<= F 1.35)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow 2.0 -0.5)))
(fma 1.0 t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.35) {
tmp = fma(-1.0, t_0, t_1);
} else if (F <= 1.35) {
tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow(2.0, -0.5));
} else {
tmp = fma(1.0, t_0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.35) tmp = fma(-1.0, t_0, t_1); elseif (F <= 1.35) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (2.0 ^ -0.5))); else tmp = fma(1.0, t_0, t_1); end return 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[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35], N[(-1.0 * t$95$0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.35], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.35:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_0, t\_1\right)\\
\mathbf{elif}\;F \leq 1.35:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {2}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, t\_0, t\_1\right)\\
\end{array}
\end{array}
if F < -1.3500000000000001Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.2%
if -1.3500000000000001 < F < 1.3500000000000001Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval56.4
Applied rewrites56.4%
if 1.3500000000000001 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5))
(t_1 (/ 1.0 (sin B)))
(t_2 (- (/ x B)))
(t_3 (/ (- x) (tan B))))
(if (<= F -86000000000000.0)
(fma -1.0 t_1 t_3)
(if (<= F -1e-168)
(fma F (/ t_0 (sin B)) t_2)
(if (<= F 1.65e-169)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 4500000.0) (fma t_1 (* t_0 F) t_2) (fma 1.0 t_1 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 = 1.0 / sin(B);
double t_2 = -(x / B);
double t_3 = -x / tan(B);
double tmp;
if (F <= -86000000000000.0) {
tmp = fma(-1.0, t_1, t_3);
} else if (F <= -1e-168) {
tmp = fma(F, (t_0 / sin(B)), t_2);
} else if (F <= 1.65e-169) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 4500000.0) {
tmp = fma(t_1, (t_0 * F), t_2);
} else {
tmp = fma(1.0, t_1, t_3);
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(1.0 / sin(B)) t_2 = Float64(-Float64(x / B)) t_3 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -86000000000000.0) tmp = fma(-1.0, t_1, t_3); elseif (F <= -1e-168) tmp = fma(F, Float64(t_0 / sin(B)), t_2); elseif (F <= 1.65e-169) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 4500000.0) tmp = fma(t_1, Float64(t_0 * F), t_2); else tmp = fma(1.0, t_1, t_3); 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[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$3 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -86000000000000.0], N[(-1.0 * t$95$1 + t$95$3), $MachinePrecision], If[LessEqual[F, -1e-168], N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[F, 1.65e-169], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4500000.0], N[(t$95$1 * N[(t$95$0 * F), $MachinePrecision] + t$95$2), $MachinePrecision], N[(1.0 * t$95$1 + t$95$3), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\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{1}{\sin B}\\
t_2 := -\frac{x}{B}\\
t_3 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -86000000000000:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_1, t\_3\right)\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-168}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{t\_0}{\sin B}, t\_2\right)\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-169}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4500000:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_0 \cdot F, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, t\_1, t\_3\right)\\
\end{array}
\end{array}
if F < -8.6e13Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.2%
if -8.6e13 < F < -1e-168Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites58.3%
if -1e-168 < F < 1.65000000000000013e-169Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
metadata-eval48.1
metadata-eval48.1
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
Applied rewrites48.2%
if 1.65000000000000013e-169 < F < 4.5e6Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites58.3%
if 4.5e6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (t_1 (- (/ x B))))
(if (<= F -86000000000000.0)
(fma -1.0 (/ 1.0 (sin B)) (/ (- x) (tan B)))
(if (<= F -1e-168)
(fma F (/ t_0 (sin B)) t_1)
(if (<= F 2.12e-165)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 3.4e+140)
(+ t_1 (/ 1.0 (/ (sin B) (* t_0 F))))
(if (<= F 1.75e+147)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (pow 2.0 -0.5)))
(fma F (/ (/ 1.0 F) (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 / B);
double tmp;
if (F <= -86000000000000.0) {
tmp = fma(-1.0, (1.0 / sin(B)), (-x / tan(B)));
} else if (F <= -1e-168) {
tmp = fma(F, (t_0 / sin(B)), t_1);
} else if (F <= 2.12e-165) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 3.4e+140) {
tmp = t_1 + (1.0 / (sin(B) / (t_0 * F)));
} else if (F <= 1.75e+147) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow(2.0, -0.5));
} else {
tmp = fma(F, ((1.0 / F) / 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(-Float64(x / B)) tmp = 0.0 if (F <= -86000000000000.0) tmp = fma(-1.0, Float64(1.0 / sin(B)), Float64(Float64(-x) / tan(B))); elseif (F <= -1e-168) tmp = fma(F, Float64(t_0 / sin(B)), t_1); elseif (F <= 2.12e-165) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 3.4e+140) tmp = Float64(t_1 + Float64(1.0 / Float64(sin(B) / Float64(t_0 * F)))); elseif (F <= 1.75e+147) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (2.0 ^ -0.5))); else tmp = fma(F, Float64(Float64(1.0 / F) / 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 / B), $MachinePrecision])}, If[LessEqual[F, -86000000000000.0], N[(-1.0 * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1e-168], N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 2.12e-165], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+140], N[(t$95$1 + N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.75e+147], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\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}{B}\\
\mathbf{if}\;F \leq -86000000000000:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-168}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{t\_0}{\sin B}, t\_1\right)\\
\mathbf{elif}\;F \leq 2.12 \cdot 10^{-165}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{+140}:\\
\;\;\;\;t\_1 + \frac{1}{\frac{\sin B}{t\_0 \cdot F}}\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{+147}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {2}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_1\right)\\
\end{array}
\end{array}
if F < -8.6e13Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.2%
if -8.6e13 < F < -1e-168Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites58.3%
if -1e-168 < F < 2.11999999999999998e-165Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
metadata-eval48.1
metadata-eval48.1
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
Applied rewrites48.2%
if 2.11999999999999998e-165 < F < 3.4e140Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
div-flipN/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6458.3
Applied rewrites58.4%
if 3.4e140 < F < 1.74999999999999987e147Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval53.4
Applied rewrites53.4%
if 1.74999999999999987e147 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B))))
(t_1 (/ F (sin B)))
(t_2
(+
(- (* x (/ 1.0 (tan B))))
(* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))))
(if (<= t_2 -1e+16)
t_0
(if (<= t_2 40.0)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) t_1) (/ x B))
(if (<= t_2 1e+305) t_0 (fma F (/ (/ 1.0 F) (sin B)) (- (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
double t_1 = F / sin(B);
double t_2 = -(x * (1.0 / tan(B))) + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
double tmp;
if (t_2 <= -1e+16) {
tmp = t_0;
} else if (t_2 <= 40.0) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * t_1) - (x / B);
} else if (t_2 <= 1e+305) {
tmp = t_0;
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), -(x / B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))) t_1 = Float64(F / sin(B)) t_2 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(t_1 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) tmp = 0.0 if (t_2 <= -1e+16) tmp = t_0; elseif (t_2 <= 40.0) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * t_1) - Float64(x / B)); elseif (t_2 <= 1e+305) tmp = t_0; else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), Float64(-Float64(x / B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(t$95$1 * 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]}, If[LessEqual[t$95$2, -1e+16], t$95$0, If[LessEqual[t$95$2, 40.0], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * t$95$1), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+305], t$95$0, N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := \left(-x \cdot \frac{1}{\tan B}\right) + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+16}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 40:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot t\_1 - \frac{x}{B}\\
\mathbf{elif}\;t\_2 \leq 10^{+305}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, -\frac{x}{B}\right)\\
\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)))))) < -1e16 or 40 < (+.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)))))) < 9.9999999999999994e304Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6461.4
Applied rewrites61.4%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites61.5%
if -1e16 < (+.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)))))) < 40Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6450.1
Applied rewrites50.1%
if 9.9999999999999994e304 < (+.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 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B)))
(t_1 (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_0)))
(if (<= F -1.75e+165)
(- (* (fma F (/ (/ -1.0 (* F (sin B))) t_0) 1.0) (/ x B)))
(if (<= F -1e-168)
t_1
(if (<= F 2.12e-165)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 3.4e+140)
t_1
(if (<= F 1.75e+147)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (pow 2.0 -0.5)))
(fma F (/ (/ 1.0 F) (sin B)) t_0))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double t_1 = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_0);
double tmp;
if (F <= -1.75e+165) {
tmp = -(fma(F, ((-1.0 / (F * sin(B))) / t_0), 1.0) * (x / B));
} else if (F <= -1e-168) {
tmp = t_1;
} else if (F <= 2.12e-165) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 3.4e+140) {
tmp = t_1;
} else if (F <= 1.75e+147) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow(2.0, -0.5));
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) t_1 = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_0) tmp = 0.0 if (F <= -1.75e+165) tmp = Float64(-Float64(fma(F, Float64(Float64(-1.0 / Float64(F * sin(B))) / t_0), 1.0) * Float64(x / B))); elseif (F <= -1e-168) tmp = t_1; elseif (F <= 2.12e-165) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 3.4e+140) tmp = t_1; elseif (F <= 1.75e+147) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (2.0 ^ -0.5))); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$1 = N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[F, -1.75e+165], (-N[(N[(F * N[(N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / B), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -1e-168], t$95$1, If[LessEqual[F, 2.12e-165], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+140], t$95$1, If[LessEqual[F, 1.75e+147], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
t_1 := \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
\mathbf{if}\;F \leq -1.75 \cdot 10^{+165}:\\
\;\;\;\;-\mathsf{fma}\left(F, \frac{\frac{-1}{F \cdot \sin B}}{t\_0}, 1\right) \cdot \frac{x}{B}\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 2.12 \cdot 10^{-165}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{+147}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {2}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.74999999999999998e165Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6428.5
Applied rewrites28.5%
if -1.74999999999999998e165 < F < -1e-168 or 2.11999999999999998e-165 < F < 3.4e140Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites58.3%
if -1e-168 < F < 2.11999999999999998e-165Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
metadata-eval48.1
metadata-eval48.1
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
Applied rewrites48.2%
if 3.4e140 < F < 1.74999999999999987e147Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval53.4
Applied rewrites53.4%
if 1.74999999999999987e147 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* x (cos B)) (sin B)))))
(if (<= x -8.0)
t_0
(if (<= x 6.5e-26)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (- (/ x B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = -((x * cos(B)) / sin(B));
double tmp;
if (x <= -8.0) {
tmp = t_0;
} else if (x <= 6.5e-26) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), -(x / B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(x * cos(B)) / sin(B))) tmp = 0.0 if (x <= -8.0) tmp = t_0; elseif (x <= 6.5e-26) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(-Float64(x / B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -8.0], t$95$0, If[LessEqual[x, 6.5e-26], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x \cdot \cos B}{\sin B}\\
\mathbf{if}\;x \leq -8:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-26}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, -\frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8 or 6.5e-26 < x Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around 0
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6454.9
Applied rewrites54.9%
if -8 < x < 6.5e-26Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites58.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sin B)))
(t_1 (- (/ x B)))
(t_2 (pow (+ 2.0 (* 2.0 x)) -0.5)))
(if (<= F -1.5e+203)
(- (* (fma F (/ (/ -1.0 (* F (sin B))) t_1) 1.0) (/ x B)))
(if (<= F -1.42)
(+ t_1 (* t_0 (/ -1.0 F)))
(if (<= F -1e-168)
(+ t_1 (* t_0 t_2))
(if (<= F 2.12e-165)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 1.4)
(+ t_1 (/ (* F t_2) (sin B)))
(fma F (/ (/ 1.0 F) (sin B)) t_1))))))))
double code(double F, double B, double x) {
double t_0 = F / sin(B);
double t_1 = -(x / B);
double t_2 = pow((2.0 + (2.0 * x)), -0.5);
double tmp;
if (F <= -1.5e+203) {
tmp = -(fma(F, ((-1.0 / (F * sin(B))) / t_1), 1.0) * (x / B));
} else if (F <= -1.42) {
tmp = t_1 + (t_0 * (-1.0 / F));
} else if (F <= -1e-168) {
tmp = t_1 + (t_0 * t_2);
} else if (F <= 2.12e-165) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 1.4) {
tmp = t_1 + ((F * t_2) / sin(B));
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sin(B)) t_1 = Float64(-Float64(x / B)) t_2 = Float64(2.0 + Float64(2.0 * x)) ^ -0.5 tmp = 0.0 if (F <= -1.5e+203) tmp = Float64(-Float64(fma(F, Float64(Float64(-1.0 / Float64(F * sin(B))) / t_1), 1.0) * Float64(x / B))); elseif (F <= -1.42) tmp = Float64(t_1 + Float64(t_0 * Float64(-1.0 / F))); elseif (F <= -1e-168) tmp = Float64(t_1 + Float64(t_0 * t_2)); elseif (F <= 2.12e-165) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 1.4) tmp = Float64(t_1 + Float64(Float64(F * t_2) / sin(B))); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$2 = N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[F, -1.5e+203], (-N[(N[(F * N[(N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / B), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -1.42], N[(t$95$1 + N[(t$95$0 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1e-168], N[(t$95$1 + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.12e-165], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$1 + N[(N[(F * t$95$2), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
t_1 := -\frac{x}{B}\\
t_2 := {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+203}:\\
\;\;\;\;-\mathsf{fma}\left(F, \frac{\frac{-1}{F \cdot \sin B}}{t\_1}, 1\right) \cdot \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.42:\\
\;\;\;\;t\_1 + t\_0 \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-168}:\\
\;\;\;\;t\_1 + t\_0 \cdot t\_2\\
\mathbf{elif}\;F \leq 2.12 \cdot 10^{-165}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_1 + \frac{F \cdot t\_2}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_1\right)\\
\end{array}
\end{array}
if F < -1.5e203Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6428.5
Applied rewrites28.5%
if -1.5e203 < F < -1.4199999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f6428.5
Applied rewrites28.5%
if -1.4199999999999999 < F < -1e-168Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval35.8
Applied rewrites35.8%
if -1e-168 < F < 2.11999999999999998e-165Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
metadata-eval48.1
metadata-eval48.1
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
Applied rewrites48.2%
if 2.11999999999999998e-165 < F < 1.3999999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6436.4
Applied rewrites36.4%
if 1.3999999999999999 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B)))
(t_1 (/ F (sin B)))
(t_2 (+ t_0 (* t_1 (pow (+ 2.0 (* 2.0 x)) -0.5)))))
(if (<= F -1.5e+203)
(- (* (fma F (/ (/ -1.0 (* F (sin B))) t_0) 1.0) (/ x B)))
(if (<= F -1.42)
(+ t_0 (* t_1 (/ -1.0 F)))
(if (<= F -1e-168)
t_2
(if (<= F 1.65e-169)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (pow 2.0 -0.5)))
(if (<= F 1.4) t_2 (fma F (/ (/ 1.0 F) (sin B)) t_0))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double t_1 = F / sin(B);
double t_2 = t_0 + (t_1 * pow((2.0 + (2.0 * x)), -0.5));
double tmp;
if (F <= -1.5e+203) {
tmp = -(fma(F, ((-1.0 / (F * sin(B))) / t_0), 1.0) * (x / B));
} else if (F <= -1.42) {
tmp = t_0 + (t_1 * (-1.0 / F));
} else if (F <= -1e-168) {
tmp = t_2;
} else if (F <= 1.65e-169) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow(2.0, -0.5));
} else if (F <= 1.4) {
tmp = t_2;
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) t_1 = Float64(F / sin(B)) t_2 = Float64(t_0 + Float64(t_1 * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))) tmp = 0.0 if (F <= -1.5e+203) tmp = Float64(-Float64(fma(F, Float64(Float64(-1.0 / Float64(F * sin(B))) / t_0), 1.0) * Float64(x / B))); elseif (F <= -1.42) tmp = Float64(t_0 + Float64(t_1 * Float64(-1.0 / F))); elseif (F <= -1e-168) tmp = t_2; elseif (F <= 1.65e-169) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (2.0 ^ -0.5))); elseif (F <= 1.4) tmp = t_2; else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + N[(t$95$1 * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e+203], (-N[(N[(F * N[(N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / B), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -1.42], N[(t$95$0 + N[(t$95$1 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1e-168], t$95$2, If[LessEqual[F, 1.65e-169], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], t$95$2, N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := t\_0 + t\_1 \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+203}:\\
\;\;\;\;-\mathsf{fma}\left(F, \frac{\frac{-1}{F \cdot \sin B}}{t\_0}, 1\right) \cdot \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.42:\\
\;\;\;\;t\_0 + t\_1 \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-168}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-169}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {2}^{-0.5}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.5e203Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6428.5
Applied rewrites28.5%
if -1.5e203 < F < -1.4199999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f6428.5
Applied rewrites28.5%
if -1.4199999999999999 < F < -1e-168 or 1.65000000000000013e-169 < F < 1.3999999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval35.8
Applied rewrites35.8%
if -1e-168 < F < 1.65000000000000013e-169Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval53.4
Applied rewrites53.4%
if 1.3999999999999999 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B)))
(t_1
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x B))))
(if (<= F -1.75e+165)
(- (* (fma F (/ (/ -1.0 (* F (sin B))) t_0) 1.0) (/ x B)))
(if (<= F -1e-168)
t_1
(if (<= F 1.65e-169)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 4.5e+38) t_1 (fma F (/ (/ 1.0 F) (sin B)) t_0)))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double t_1 = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / B);
double tmp;
if (F <= -1.75e+165) {
tmp = -(fma(F, ((-1.0 / (F * sin(B))) / t_0), 1.0) * (x / B));
} else if (F <= -1e-168) {
tmp = t_1;
} else if (F <= 1.65e-169) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 4.5e+38) {
tmp = t_1;
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) t_1 = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B)) tmp = 0.0 if (F <= -1.75e+165) tmp = Float64(-Float64(fma(F, Float64(Float64(-1.0 / Float64(F * sin(B))) / t_0), 1.0) * Float64(x / B))); elseif (F <= -1e-168) tmp = t_1; elseif (F <= 1.65e-169) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 4.5e+38) tmp = t_1; else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$1 = N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.75e+165], (-N[(N[(F * N[(N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / B), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -1e-168], t$95$1, If[LessEqual[F, 1.65e-169], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e+38], t$95$1, N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
t_1 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -1.75 \cdot 10^{+165}:\\
\;\;\;\;-\mathsf{fma}\left(F, \frac{\frac{-1}{F \cdot \sin B}}{t\_0}, 1\right) \cdot \frac{x}{B}\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-169}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.74999999999999998e165Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6428.5
Applied rewrites28.5%
if -1.74999999999999998e165 < F < -1e-168 or 1.65000000000000013e-169 < F < 4.4999999999999998e38Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6450.1
Applied rewrites50.1%
if -1e-168 < F < 1.65000000000000013e-169Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
metadata-eval48.1
metadata-eval48.1
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
Applied rewrites48.2%
if 4.4999999999999998e38 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))) (t_1 (/ F (sin B))))
(if (<= F -1.5e+203)
(- (* (fma F (/ (/ -1.0 (* F (sin B))) t_0) 1.0) (/ x B)))
(if (<= F -1.42)
(+ t_0 (* t_1 (/ -1.0 F)))
(if (<= F 1.4)
(+ t_0 (* t_1 (pow (+ 2.0 (* 2.0 x)) -0.5)))
(fma F (/ (/ 1.0 F) (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double t_1 = F / sin(B);
double tmp;
if (F <= -1.5e+203) {
tmp = -(fma(F, ((-1.0 / (F * sin(B))) / t_0), 1.0) * (x / B));
} else if (F <= -1.42) {
tmp = t_0 + (t_1 * (-1.0 / F));
} else if (F <= 1.4) {
tmp = t_0 + (t_1 * pow((2.0 + (2.0 * x)), -0.5));
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) t_1 = Float64(F / sin(B)) tmp = 0.0 if (F <= -1.5e+203) tmp = Float64(-Float64(fma(F, Float64(Float64(-1.0 / Float64(F * sin(B))) / t_0), 1.0) * Float64(x / B))); elseif (F <= -1.42) tmp = Float64(t_0 + Float64(t_1 * Float64(-1.0 / F))); elseif (F <= 1.4) tmp = Float64(t_0 + Float64(t_1 * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e+203], (-N[(N[(F * N[(N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / B), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -1.42], N[(t$95$0 + N[(t$95$1 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + N[(t$95$1 * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
t_1 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+203}:\\
\;\;\;\;-\mathsf{fma}\left(F, \frac{\frac{-1}{F \cdot \sin B}}{t\_0}, 1\right) \cdot \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.42:\\
\;\;\;\;t\_0 + t\_1 \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_0 + t\_1 \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.5e203Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6428.5
Applied rewrites28.5%
if -1.5e203 < F < -1.4199999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f6428.5
Applied rewrites28.5%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval35.8
Applied rewrites35.8%
if 1.3999999999999999 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -1.5e+203)
(- (* (fma F (/ (/ -1.0 (* F (sin B))) t_0) 1.0) (/ x B)))
(if (<= F -1.42)
(+ t_0 (* (/ F (sin B)) (/ -1.0 F)))
(if (<= F 1.4)
(+ t_0 (/ (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) (sin B)))
(fma F (/ (/ 1.0 F) (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.5e+203) {
tmp = -(fma(F, ((-1.0 / (F * sin(B))) / t_0), 1.0) * (x / B));
} else if (F <= -1.42) {
tmp = t_0 + ((F / sin(B)) * (-1.0 / F));
} else if (F <= 1.4) {
tmp = t_0 + ((F * pow((2.0 + (2.0 * x)), -0.5)) / sin(B));
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.5e+203) tmp = Float64(-Float64(fma(F, Float64(Float64(-1.0 / Float64(F * sin(B))) / t_0), 1.0) * Float64(x / B))); elseif (F <= -1.42) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(-1.0 / F))); elseif (F <= 1.4) tmp = Float64(t_0 + Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) / sin(B))); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.5e+203], (-N[(N[(F * N[(N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / B), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -1.42], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+203}:\\
\;\;\;\;-\mathsf{fma}\left(F, \frac{\frac{-1}{F \cdot \sin B}}{t\_0}, 1\right) \cdot \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.42:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_0 + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.5e203Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6428.5
Applied rewrites28.5%
if -1.5e203 < F < -1.4199999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f6428.5
Applied rewrites28.5%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6436.4
Applied rewrites36.4%
if 1.3999999999999999 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -1.5e+203)
(- (* (fma F (/ (/ -1.0 (* F (sin B))) t_0) 1.0) (/ x B)))
(if (<= F -1.4e+16)
(+ t_0 (* (/ F (sin B)) (/ -1.0 F)))
(if (<= F 440.0)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma F (/ (/ 1.0 F) (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.5e+203) {
tmp = -(fma(F, ((-1.0 / (F * sin(B))) / t_0), 1.0) * (x / B));
} else if (F <= -1.4e+16) {
tmp = t_0 + ((F / sin(B)) * (-1.0 / F));
} else if (F <= 440.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.5e+203) tmp = Float64(-Float64(fma(F, Float64(Float64(-1.0 / Float64(F * sin(B))) / t_0), 1.0) * Float64(x / B))); elseif (F <= -1.4e+16) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(-1.0 / F))); elseif (F <= 440.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.5e+203], (-N[(N[(F * N[(N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x / B), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -1.4e+16], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 440.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+203}:\\
\;\;\;\;-\mathsf{fma}\left(F, \frac{\frac{-1}{F \cdot \sin B}}{t\_0}, 1\right) \cdot \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.4 \cdot 10^{+16}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq 440:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.5e203Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6428.5
Applied rewrites28.5%
if -1.5e203 < F < -1.4e16Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f6428.5
Applied rewrites28.5%
if -1.4e16 < F < 440Initial program 76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.2%
if 440 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -1.4e+16)
(+ t_0 (* (/ F (sin B)) (/ -1.0 F)))
(if (<= F 440.0)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma F (/ (/ 1.0 F) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.4e+16) {
tmp = t_0 + ((F / sin(B)) * (-1.0 / F));
} else if (F <= 440.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.4e+16) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(-1.0 / F))); elseif (F <= 440.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.4e+16], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 440.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.4 \cdot 10^{+16}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq 440:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.4e16Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around -inf
lower-/.f6428.5
Applied rewrites28.5%
if -1.4e16 < F < 440Initial program 76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.2%
if 440 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.42e+65)
(/ -1.0 (sin B))
(if (<= F 440.0)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma F (/ (/ 1.0 F) (sin B)) (- (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.42e+65) {
tmp = -1.0 / sin(B);
} else if (F <= 440.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), -(x / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.42e+65) tmp = Float64(-1.0 / sin(B)); elseif (F <= 440.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), Float64(-Float64(x / B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.42e+65], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 440.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.42 \cdot 10^{+65}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 440:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, -\frac{x}{B}\right)\\
\end{array}
\end{array}
if F < -1.42000000000000012e65Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8
Applied rewrites17.8%
if -1.42000000000000012e65 < F < 440Initial program 76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.2%
if 440 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -1.42e+65)
(/ -1.0 (sin B))
(if (<= F 440.0)
(+ t_0 (* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(fma F (/ (/ 1.0 F) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.42e+65) {
tmp = -1.0 / sin(B);
} else if (F <= 440.0) {
tmp = t_0 + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.42e+65) tmp = Float64(-1.0 / sin(B)); elseif (F <= 440.0) tmp = Float64(t_0 + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.42e+65], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 440.0], N[(t$95$0 + N[(N[(F / B), $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[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.42 \cdot 10^{+65}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 440:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -1.42000000000000012e65Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8
Applied rewrites17.8%
if -1.42000000000000012e65 < F < 440Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6461.4
Applied rewrites61.4%
Taylor expanded in B around 0
lower-/.f6435.9
Applied rewrites35.9%
if 440 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Taylor expanded in F around inf
lower-/.f6428.0
Applied rewrites28.0%
metadata-eval28.0
metadata-eval28.0
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.42e+65)
(/ -1.0 (sin B))
(if (<= F 45000.0)
(+
(- (/ x B))
(* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.42e+65) {
tmp = -1.0 / sin(B);
} else if (F <= 45000.0) {
tmp = -(x / B) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = 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) :: tmp
if (f <= (-1.42d+65)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 45000.0d0) then
tmp = -(x / b) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.42e+65) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 45000.0) {
tmp = -(x / B) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.42e+65: tmp = -1.0 / math.sin(B) elif F <= 45000.0: tmp = -(x / B) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.42e+65) tmp = Float64(-1.0 / sin(B)); elseif (F <= 45000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.42e+65) tmp = -1.0 / sin(B); elseif (F <= 45000.0) tmp = -(x / B) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.42e+65], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 45000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $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[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.42 \cdot 10^{+65}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 45000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.42000000000000012e65Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8
Applied rewrites17.8%
if -1.42000000000000012e65 < F < 45000Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6461.4
Applied rewrites61.4%
Taylor expanded in B around 0
lower-/.f6435.9
Applied rewrites35.9%
if 45000 < F Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
(FPCore (F B x)
:precision binary64
(if (<= F -2300.0)
(/ -1.0 (sin B))
(if (<= F 1.2e-27)
(+ (- (* x (/ 1.0 B))) (* (/ F B) (pow (+ 2.0 (* 2.0 x)) -0.5)))
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2300.0) {
tmp = -1.0 / sin(B);
} else if (F <= 1.2e-27) {
tmp = -(x * (1.0 / B)) + ((F / B) * pow((2.0 + (2.0 * x)), -0.5));
} else {
tmp = 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) :: tmp
if (f <= (-2300.0d0)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 1.2d-27) then
tmp = -(x * (1.0d0 / b)) + ((f / b) * ((2.0d0 + (2.0d0 * x)) ** (-0.5d0)))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2300.0) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 1.2e-27) {
tmp = -(x * (1.0 / B)) + ((F / B) * Math.pow((2.0 + (2.0 * x)), -0.5));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2300.0: tmp = -1.0 / math.sin(B) elif F <= 1.2e-27: tmp = -(x * (1.0 / B)) + ((F / B) * math.pow((2.0 + (2.0 * x)), -0.5)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2300.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.2e-27) tmp = Float64(Float64(-Float64(x * Float64(1.0 / B))) + Float64(Float64(F / B) * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2300.0) tmp = -1.0 / sin(B); elseif (F <= 1.2e-27) tmp = -(x * (1.0 / B)) + ((F / B) * ((2.0 + (2.0 * x)) ^ -0.5)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2300.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e-27], N[((-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2300:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-27}:\\
\;\;\;\;\left(-x \cdot \frac{1}{B}\right) + \frac{F}{B} \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2300Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8
Applied rewrites17.8%
if -2300 < F < 1.20000000000000001e-27Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.1
Applied rewrites54.1%
Taylor expanded in B around 0
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in B around 0
lower-/.f6428.7
Applied rewrites28.7%
if 1.20000000000000001e-27 < F Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
(FPCore (F B x) :precision binary64 (if (<= F -9.8e-18) (/ -1.0 (sin B)) (if (<= F 3.9e-47) (- (* 1.0 (/ x B))) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.8e-18) {
tmp = -1.0 / sin(B);
} else if (F <= 3.9e-47) {
tmp = -(1.0 * (x / B));
} else {
tmp = 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) :: tmp
if (f <= (-9.8d-18)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 3.9d-47) then
tmp = -(1.0d0 * (x / b))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9.8e-18) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 3.9e-47) {
tmp = -(1.0 * (x / B));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.8e-18: tmp = -1.0 / math.sin(B) elif F <= 3.9e-47: tmp = -(1.0 * (x / B)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.8e-18) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3.9e-47) tmp = Float64(-Float64(1.0 * Float64(x / B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9.8e-18) tmp = -1.0 / sin(B); elseif (F <= 3.9e-47) tmp = -(1.0 * (x / B)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.8e-18], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e-47], (-N[(1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.8 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-47}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -9.8000000000000002e-18Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8
Applied rewrites17.8%
if -9.8000000000000002e-18 < F < 3.89999999999999978e-47Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around 0
Applied rewrites29.4%
if 3.89999999999999978e-47 < F Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
(FPCore (F B x) :precision binary64 (if (<= B 4.7e-29) (- (* 1.0 (/ x B))) (/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 4.7e-29) {
tmp = -(1.0 * (x / B));
} else {
tmp = -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) :: tmp
if (b <= 4.7d-29) then
tmp = -(1.0d0 * (x / b))
else
tmp = (-1.0d0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 4.7e-29) {
tmp = -(1.0 * (x / B));
} else {
tmp = -1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 4.7e-29: tmp = -(1.0 * (x / B)) else: tmp = -1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 4.7e-29) tmp = Float64(-Float64(1.0 * Float64(x / B))); else tmp = Float64(-1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 4.7e-29) tmp = -(1.0 * (x / B)); else tmp = -1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 4.7e-29], (-N[(1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.7 \cdot 10^{-29}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if B < 4.6999999999999998e-29Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around 0
Applied rewrites29.4%
if 4.6999999999999998e-29 < B Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8
Applied rewrites17.8%
(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 * Float64(x / B))) end
function tmp = code(F, B, x) tmp = -(1.0 * (x / B)); end
code[F_, B_, x_] := (-N[(1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
\\
-1 \cdot \frac{x}{B}
\end{array}
Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6450.1
Applied rewrites50.1%
Applied rewrites49.7%
Taylor expanded in F around 0
Applied rewrites29.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 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.8%
herbie shell --seed 2025148
(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))))))