
(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}
Sampling outcomes in binary64 precision:
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 (* (cos B) x)))
(if (<= F -2e+20)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1e+55)
(+
(/ (- x) (tan B))
(/
(* F (pow (fma 2.0 x (/ (- (pow F 4.0) 4.0) (- (* F F) 2.0))) -0.5))
(sin B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2e+20) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1e+55) {
tmp = (-x / tan(B)) + ((F * pow(fma(2.0, x, ((pow(F, 4.0) - 4.0) / ((F * F) - 2.0))), -0.5)) / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2e+20) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1e+55) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F * (fma(2.0, x, Float64(Float64((F ^ 4.0) - 4.0) / Float64(Float64(F * F) - 2.0))) ^ -0.5)) / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2e+20], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+55], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[Power[N[(2.0 * x + N[(N[(N[Power[F, 4.0], $MachinePrecision] - 4.0), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+55}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \frac{{F}^{4} - 4}{F \cdot F - 2}\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2e20Initial program 56.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -2e20 < F < 1.00000000000000001e55Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.7
Applied rewrites99.7%
lift-fma.f64N/A
pow2N/A
flip-+N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
sqr-powN/A
metadata-evalN/A
lower--.f64N/A
lower-pow.f64N/A
lower--.f64N/A
pow2N/A
lower-*.f6499.7
Applied rewrites99.7%
if 1.00000000000000001e55 < F Initial program 50.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2e+20)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1.45e+106)
(+
(* x (/ -1.0 (tan B)))
(/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2e+20) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1.45e+106) {
tmp = (x * (-1.0 / tan(B))) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2e+20) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1.45e+106) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2e+20], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e+106], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+106}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2e20Initial program 56.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -2e20 < F < 1.4500000000000001e106Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
if 1.4500000000000001e106 < F Initial program 40.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2e+20)
(/ (- -1.0 t_0) (sin B))
(if (<= F 2e+101)
(+
(/ (- x) (tan B))
(/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2e+20) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 2e+101) {
tmp = (-x / tan(B)) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2e+20) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 2e+101) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2e+20], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+101], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+101}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2e20Initial program 56.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -2e20 < F < 2e101Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.7
Applied rewrites99.7%
if 2e101 < F Initial program 40.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -4e+20)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1.16e+50)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -4e+20) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1.16e+50) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -4e+20) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1.16e+50) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -4e+20], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.16e+50], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.16 \cdot 10^{+50}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -4e20Initial program 55.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -4e20 < F < 1.16e50Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6499.5
Applied rewrites99.5%
if 1.16e50 < F Initial program 51.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -5e+60)
(/ (- -1.0 t_0) (sin B))
(if (<= F 2e+101)
(+
(* x (/ -1.0 (tan B)))
(/ F (* (sin B) (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -5e+60) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 2e+101) {
tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -5e+60) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 2e+101) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -5e+60], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+101], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -5 \cdot 10^{+60}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+101}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B \cdot \sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -4.99999999999999975e60Initial program 50.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -4.99999999999999975e60 < F < 2e101Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-sqrt.f6499.5
Applied rewrites99.5%
if 2e101 < F Initial program 40.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5))) (t_1 (* (cos B) x)))
(if (<= F -0.84)
(/ (- -1.0 t_1) (sin B))
(if (<= F 8e-106)
(+ (/ (- x) (tan B)) (/ t_0 B))
(if (<= F 2e+47)
(+ (- (/ x B)) (/ t_0 (sin B)))
(/ (- 1.0 t_1) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
double t_1 = cos(B) * x;
double tmp;
if (F <= -0.84) {
tmp = (-1.0 - t_1) / sin(B);
} else if (F <= 8e-106) {
tmp = (-x / tan(B)) + (t_0 / B);
} else if (F <= 2e+47) {
tmp = -(x / B) + (t_0 / sin(B));
} else {
tmp = (1.0 - t_1) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) t_1 = Float64(cos(B) * x) tmp = 0.0 if (F <= -0.84) tmp = Float64(Float64(-1.0 - t_1) / sin(B)); elseif (F <= 8e-106) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(t_0 / B)); elseif (F <= 2e+47) tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 / sin(B))); else tmp = Float64(Float64(1.0 - t_1) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -0.84], N[(N[(-1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-106], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(t$95$0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+47], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -0.84:\\
\;\;\;\;\frac{-1 - t\_1}{\sin B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-106}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{t\_0}{B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+47}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_1}{\sin B}\\
\end{array}
\end{array}
if F < -0.839999999999999969Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -0.839999999999999969 < F < 7.99999999999999953e-106Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
Applied rewrites90.6%
if 7.99999999999999953e-106 < F < 2.0000000000000001e47Initial program 99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6499.5
Applied rewrites99.5%
if 2.0000000000000001e47 < F Initial program 52.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Final simplification96.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)) (t_1 (fma 2.0 x (fma F F 2.0))))
(if (<= F -0.84)
(/ (- -1.0 t_0) (sin B))
(if (<= F 8e-106)
(+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 1.0 t_1))))
(if (<= F 2e+47)
(+ (- (/ x B)) (/ (* F (pow t_1 -0.5)) (sin B)))
(/ (- 1.0 t_0) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double t_1 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -0.84) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 8e-106) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / t_1)));
} else if (F <= 2e+47) {
tmp = -(x / B) + ((F * pow(t_1, -0.5)) / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) t_1 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -0.84) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 8e-106) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_1)))); elseif (F <= 2e+47) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (t_1 ^ -0.5)) / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.84], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-106], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+47], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
t_1 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -0.84:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_1}}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+47}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {t\_1}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -0.839999999999999969Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -0.839999999999999969 < F < 7.99999999999999953e-106Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6490.4
Applied rewrites90.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6490.4
Applied rewrites90.4%
if 7.99999999999999953e-106 < F < 2.0000000000000001e47Initial program 99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6499.5
Applied rewrites99.5%
if 2.0000000000000001e47 < F Initial program 52.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Final simplification96.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -0.84)
(/ (- -1.0 t_0) (sin B))
(if (<= F 5e-94)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
(if (<= F 510000.0)
(+
(- (/ x B))
(* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(/ (- 1.0 t_0) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -0.84) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 5e-94) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
} else if (F <= 510000.0) {
tmp = -(x / B) + ((F / sin(B)) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -0.84) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 5e-94) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))))); elseif (F <= 510000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -0.84], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-94], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 510000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -0.84:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{elif}\;F \leq 510000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -0.839999999999999969Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -0.839999999999999969 < F < 4.9999999999999995e-94Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6490.6
Applied rewrites90.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6490.6
Applied rewrites90.6%
if 4.9999999999999995e-94 < F < 5.1e5Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in B around 0
lower-/.f6498.8
Applied rewrites98.8%
if 5.1e5 < F Initial program 58.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Final simplification96.3%
(FPCore (F B x)
:precision binary64
(if (<= F -80000.0)
(/ (- -1.0 x) (sin B))
(if (<= F 5e-94)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
(if (<= F 510000.0)
(+
(- (/ x B))
(* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -80000.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 5e-94) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
} else if (F <= 510000.0) {
tmp = -(x / B) + ((F / sin(B)) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -80000.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 5e-94) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))))); elseif (F <= 510000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -80000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-94], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 510000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -80000:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{elif}\;F \leq 510000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -8e4Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites80.5%
if -8e4 < F < 4.9999999999999995e-94Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6490.6
Applied rewrites90.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6490.6
Applied rewrites90.6%
if 4.9999999999999995e-94 < F < 5.1e5Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in B around 0
lower-/.f6498.8
Applied rewrites98.8%
if 5.1e5 < F Initial program 58.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Final simplification90.7%
(FPCore (F B x)
:precision binary64
(if (<= F -80000.0)
(/ (- -1.0 x) (sin B))
(if (<= F 5e-94)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
(if (<= F 19000000.0)
(+
(- (/ x B))
(* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -80000.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 5e-94) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
} else if (F <= 19000000.0) {
tmp = -(x / B) + ((F / sin(B)) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -80000.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 5e-94) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))))); elseif (F <= 19000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -80000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-94], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 19000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -80000:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{elif}\;F \leq 19000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -8e4Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites80.5%
if -8e4 < F < 4.9999999999999995e-94Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6490.6
Applied rewrites90.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6490.6
Applied rewrites90.6%
if 4.9999999999999995e-94 < F < 1.9e7Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6499.1
Applied rewrites99.1%
Taylor expanded in B around 0
lower-/.f6498.8
Applied rewrites98.8%
if 1.9e7 < F Initial program 58.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites67.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites82.0%
Final simplification85.9%
(FPCore (F B x)
:precision binary64
(if (or (<= x -3.5e-30) (not (<= x 5.6e-6)))
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(+
(- (/ x B))
(* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -3.5e-30) || !(x <= 5.6e-6)) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else {
tmp = -(x / B) + ((F / sin(B)) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -3.5e-30) || !(x <= 5.6e-6)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); else tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -3.5e-30], N[Not[LessEqual[x, 5.6e-6]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-30} \lor \neg \left(x \leq 5.6 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\end{array}
\end{array}
if x < -3.5000000000000003e-30 or 5.59999999999999975e-6 < x Initial program 84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6484.7
Applied rewrites84.7%
Taylor expanded in F around -inf
lower-/.f6497.4
Applied rewrites97.4%
if -3.5000000000000003e-30 < x < 5.59999999999999975e-6Initial program 70.7%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites72.2%
Taylor expanded in B around inf
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6470.6
Applied rewrites70.6%
Taylor expanded in B around 0
lower-/.f6461.3
Applied rewrites61.3%
Final simplification76.1%
(FPCore (F B x)
:precision binary64
(if (<= F -3.5)
(/ (- -1.0 x) (sin B))
(if (<= F 2e-107)
(+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 0.5 x))))
(if (<= F 15500.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.5) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 2e-107) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((0.5 / x)));
} else if (F <= 15500.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.5) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 2e-107) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(0.5 / x)))); elseif (F <= 15500.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.5], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-107], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(0.5 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 15500.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.5:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-107}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{0.5}{x}}\\
\mathbf{elif}\;F \leq 15500:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -3.5Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites80.5%
if -3.5 < F < 2e-107Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6490.4
Applied rewrites90.4%
Taylor expanded in x around inf
metadata-evalN/A
lower-/.f64N/A
metadata-eval56.2
Applied rewrites56.2%
if 2e-107 < F < 15500Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites66.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6466.5
Applied rewrites66.5%
if 15500 < F Initial program 58.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites67.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites82.0%
Final simplification71.0%
(FPCore (F B x)
:precision binary64
(if (<= F -0.84)
(/ (- -1.0 x) (sin B))
(if (<= F 15500.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.84) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 15500.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.84) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 15500.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.84], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 15500.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.84:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 15500:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -0.839999999999999969Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites80.5%
if -0.839999999999999969 < F < 15500Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.1%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6452.1
Applied rewrites52.1%
if 15500 < F Initial program 58.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites67.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites82.0%
Final simplification68.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2150000000.0)
(/ -1.0 (sin B))
(if (<= F 15500.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2150000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 15500.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2150000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 15500.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2150000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 15500.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2150000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 15500:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -2.15e9Initial program 56.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6457.4
Applied rewrites57.4%
if -2.15e9 < F < 15500Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.1%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6452.1
Applied rewrites52.1%
if 15500 < F Initial program 58.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites67.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites82.0%
Final simplification61.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2150000000.0)
(/ -1.0 (sin B))
(if (<= F 5.2e+124)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2150000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 5.2e+124) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2150000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 5.2e+124) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2150000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e+124], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2150000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+124}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.15e9Initial program 56.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6457.4
Applied rewrites57.4%
if -2.15e9 < F < 5.2000000000000001e124Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites54.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6454.4
Applied rewrites54.4%
if 5.2000000000000001e124 < F Initial program 35.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites49.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites62.6%
Final simplification56.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2150000000.0)
(/ -1.0 (sin B))
(if (<= F 1.35e+96)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/
(- (+ 1.0 (* (* B B) (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))))) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2150000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 1.35e+96) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = ((1.0 + ((B * B) * fma(0.5, x, (0.16666666666666666 * (1.0 - x))))) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2150000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.35e+96) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(B * B) * fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))))) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2150000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e+96], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2150000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+96}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right)\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.15e9Initial program 56.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6457.4
Applied rewrites57.4%
if -2.15e9 < F < 1.35000000000000011e96Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites54.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6454.6
Applied rewrites54.6%
if 1.35000000000000011e96 < F Initial program 45.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites57.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites48.1%
Final simplification54.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+157)
(/
(-
(* (* B B) (* x (+ 0.3333333333333333 (* 0.022222222222222223 (* B B)))))
(+ 1.0 x))
B)
(if (<= F 1.35e+96)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/
(- (+ 1.0 (* (* B B) (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))))) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+157) {
tmp = (((B * B) * (x * (0.3333333333333333 + (0.022222222222222223 * (B * B))))) - (1.0 + x)) / B;
} else if (F <= 1.35e+96) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = ((1.0 + ((B * B) * fma(0.5, x, (0.16666666666666666 * (1.0 - x))))) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+157) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(x * Float64(0.3333333333333333 + Float64(0.022222222222222223 * Float64(B * B))))) - Float64(1.0 + x)) / B); elseif (F <= 1.35e+96) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(B * B) * fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))))) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+157], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * N[(0.3333333333333333 + N[(0.022222222222222223 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.35e+96], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+157}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot \left(0.3333333333333333 + 0.022222222222222223 \cdot \left(B \cdot B\right)\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+96}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right)\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.94999999999999985e157Initial program 28.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6447.6
Applied rewrites47.6%
if -1.94999999999999985e157 < F < 1.35000000000000011e96Initial program 97.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lower-fma.f64N/A
lift-fma.f6451.4
Applied rewrites51.4%
if 1.35000000000000011e96 < F Initial program 45.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites57.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites48.1%
Final simplification50.1%
(FPCore (F B x)
:precision binary64
(if (<= F -3.2e+44)
(/
(-
(* (* B B) (* x (+ 0.3333333333333333 (* 0.022222222222222223 (* B B)))))
(+ 1.0 x))
B)
(if (<= F 1.92)
(fma -1.0 (/ x B) (* (/ F B) (sqrt 0.5)))
(/
(- (+ 1.0 (* (* B B) (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))))) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e+44) {
tmp = (((B * B) * (x * (0.3333333333333333 + (0.022222222222222223 * (B * B))))) - (1.0 + x)) / B;
} else if (F <= 1.92) {
tmp = fma(-1.0, (x / B), ((F / B) * sqrt(0.5)));
} else {
tmp = ((1.0 + ((B * B) * fma(0.5, x, (0.16666666666666666 * (1.0 - x))))) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.2e+44) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(x * Float64(0.3333333333333333 + Float64(0.022222222222222223 * Float64(B * B))))) - Float64(1.0 + x)) / B); elseif (F <= 1.92) tmp = fma(-1.0, Float64(x / B), Float64(Float64(F / B) * sqrt(0.5))); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(B * B) * fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))))) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.2e+44], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * N[(0.3333333333333333 + N[(0.022222222222222223 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.92], N[(-1.0 * N[(x / B), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(x \cdot \left(0.3333333333333333 + 0.022222222222222223 \cdot \left(B \cdot B\right)\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.92:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{x}{B}, \frac{F}{B} \cdot \sqrt{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right)\right) - x}{B}\\
\end{array}
\end{array}
if F < -3.20000000000000004e44Initial program 53.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites44.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6445.4
Applied rewrites45.4%
if -3.20000000000000004e44 < F < 1.9199999999999999Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.7%
Taylor expanded in F around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f6449.7
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites49.7%
if 1.9199999999999999 < F Initial program 59.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites54.5%
Final simplification49.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.2e+44)
(/ (- -1.0 x) B)
(if (<= F 1.92)
(fma -1.0 (/ x B) (* (/ F B) (sqrt 0.5)))
(/
(- (+ 1.0 (* (* B B) (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))))) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e+44) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.92) {
tmp = fma(-1.0, (x / B), ((F / B) * sqrt(0.5)));
} else {
tmp = ((1.0 + ((B * B) * fma(0.5, x, (0.16666666666666666 * (1.0 - x))))) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.2e+44) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.92) tmp = fma(-1.0, Float64(x / B), Float64(Float64(F / B) * sqrt(0.5))); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(B * B) * fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))))) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.2e+44], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.92], N[(-1.0 * N[(x / B), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.92:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{x}{B}, \frac{F}{B} \cdot \sqrt{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right)\right) - x}{B}\\
\end{array}
\end{array}
if F < -3.20000000000000004e44Initial program 53.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites31.9%
Taylor expanded in F around -inf
Applied rewrites44.9%
if -3.20000000000000004e44 < F < 1.9199999999999999Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.7%
Taylor expanded in F around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f6449.7
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites49.7%
if 1.9199999999999999 < F Initial program 59.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites54.5%
Final simplification49.8%
(FPCore (F B x)
:precision binary64
(if (<= F -4.6e-71)
(/ (- -1.0 x) B)
(if (<= F 2.5e-52)
(/ (- x) B)
(/ (- 1.0 x) (* B (+ 1.0 (* -0.16666666666666666 (* B B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-71) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-52) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / (B * (1.0 + (-0.16666666666666666 * (B * 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 <= (-4.6d-71)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.5d-52) then
tmp = -x / b
else
tmp = (1.0d0 - x) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b * b))))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-71) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-52) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / (B * (1.0 + (-0.16666666666666666 * (B * B))));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.6e-71: tmp = (-1.0 - x) / B elif F <= 2.5e-52: tmp = -x / B else: tmp = (1.0 - x) / (B * (1.0 + (-0.16666666666666666 * (B * B)))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.6e-71) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.5e-52) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * B))))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.6e-71) tmp = (-1.0 - x) / B; elseif (F <= 2.5e-52) tmp = -x / B; else tmp = (1.0 - x) / (B * (1.0 + (-0.16666666666666666 * (B * B)))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.6e-71], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-52], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.6 \cdot 10^{-71}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-52}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\
\end{array}
\end{array}
if F < -4.5999999999999997e-71Initial program 64.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites34.7%
Taylor expanded in F around -inf
Applied rewrites41.4%
if -4.5999999999999997e-71 < F < 2.5e-52Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.2%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6436.9
Applied rewrites36.9%
if 2.5e-52 < F Initial program 62.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites71.1%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6494.5
Applied rewrites94.5%
Taylor expanded in B around 0
Applied rewrites78.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6453.1
Applied rewrites53.1%
Final simplification43.3%
(FPCore (F B x) :precision binary64 (if (<= F -4.6e-71) (/ (- -1.0 x) B) (if (<= F 3.15e-43) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-71) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.15e-43) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.6d-71)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.15d-43) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-71) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.15e-43) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.6e-71: tmp = (-1.0 - x) / B elif F <= 3.15e-43: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.6e-71) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.15e-43) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.6e-71) tmp = (-1.0 - x) / B; elseif (F <= 3.15e-43) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.6e-71], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.15e-43], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.6 \cdot 10^{-71}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.15 \cdot 10^{-43}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.5999999999999997e-71Initial program 64.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites34.7%
Taylor expanded in F around -inf
Applied rewrites41.4%
if -4.5999999999999997e-71 < F < 3.1500000000000001e-43Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.7%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6437.8
Applied rewrites37.8%
if 3.1500000000000001e-43 < F Initial program 61.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.6%
Taylor expanded in F around inf
Applied rewrites51.8%
(FPCore (F B x) :precision binary64 (if (<= F -4.6e-71) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-71) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.6d-71)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-71) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.6e-71: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.6e-71) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.6e-71) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.6e-71], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.6 \cdot 10^{-71}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -4.5999999999999997e-71Initial program 64.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites34.7%
Taylor expanded in F around -inf
Applied rewrites41.4%
if -4.5999999999999997e-71 < F Initial program 82.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.0%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6432.4
Applied rewrites32.4%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -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 = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 76.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites42.1%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6429.3
Applied rewrites29.3%
herbie shell --seed 2025043
(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))))))