
(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 19 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
(if (<= F -2.6e+86)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 100000000.0)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e+86) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 100000000.0) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.6e+86) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 100000000.0) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.6e+86], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $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 -2.6 \cdot 10^{+86}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.5999999999999998e86Initial program 47.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites34.1%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6426.1
Applied rewrites26.1%
Taylor expanded in F around -inf
mul-1-negN/A
*-commutativeN/A
div-addN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -2.5999999999999998e86 < F < 1e8Initial program 98.8%
Applied rewrites98.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
inv-powN/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lower-/.f64N/A
lift-neg.f64N/A
lift-tan.f6499.0
Applied rewrites99.0%
if 1e8 < F Initial program 57.3%
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%
(FPCore (F B x)
:precision binary64
(if (<= F -2.6e+86)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 100000000.0)
(fma
(/ 1.0 (sqrt (fma F F (fma x 2.0 2.0))))
(/ F (sin B))
(/ (- x) (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e+86) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 100000000.0) {
tmp = fma((1.0 / sqrt(fma(F, F, fma(x, 2.0, 2.0)))), (F / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.6e+86) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 100000000.0) tmp = fma(Float64(1.0 / sqrt(fma(F, F, fma(x, 2.0, 2.0)))), Float64(F / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.6e+86], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(1.0 / N[Sqrt[N[(F * F + N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $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 -2.6 \cdot 10^{+86}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.5999999999999998e86Initial program 47.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites34.1%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6426.1
Applied rewrites26.1%
Taylor expanded in F around -inf
mul-1-negN/A
*-commutativeN/A
div-addN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -2.5999999999999998e86 < F < 1e8Initial program 98.8%
Applied rewrites98.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
inv-powN/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lower-/.f64N/A
lift-neg.f64N/A
lift-tan.f6499.0
Applied rewrites99.0%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites98.9%
if 1e8 < F Initial program 57.3%
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%
(FPCore (F B x)
:precision binary64
(if (<= F -92000.0)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 40000.0)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F 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 <= -92000.0) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 40000.0) {
tmp = -((x * 1.0) / tan(B)) + ((F / 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 <= -92000.0) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 40000.0) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / 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, -92000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 40000.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $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 -92000:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 40000:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{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 < -92000Initial program 58.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.2%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6424.4
Applied rewrites24.4%
Taylor expanded in F around -inf
mul-1-negN/A
*-commutativeN/A
div-addN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -92000 < F < 4e4Initial program 99.4%
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
lower-*.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-*.f64N/A
lift-fma.f6482.0
Applied rewrites82.0%
if 4e4 < F Initial program 57.5%
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%
(FPCore (F B x)
:precision binary64
(if (<= F -92000.0)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 1.95e+77)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(pow (sin B) -1.0))))
double code(double F, double B, double x) {
double tmp;
if (F <= -92000.0) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 1.95e+77) {
tmp = -((x * 1.0) / tan(B)) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -92000.0) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 1.95e+77) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -92000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e+77], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -92000:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{+77}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if F < -92000Initial program 58.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.2%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6424.4
Applied rewrites24.4%
Taylor expanded in F around -inf
mul-1-negN/A
*-commutativeN/A
div-addN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -92000 < F < 1.9499999999999999e77Initial program 98.9%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.1
Applied rewrites99.1%
Taylor expanded in B around 0
lower-*.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-*.f64N/A
lift-fma.f6480.5
Applied rewrites80.5%
if 1.9499999999999999e77 < F Initial program 48.2%
Applied rewrites48.2%
lift-neg.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
inv-powN/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lower-/.f64N/A
lift-neg.f64N/A
lift-tan.f6448.2
Applied rewrites48.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6414.4
Applied rewrites14.4%
Taylor expanded in F around inf
inv-powN/A
lower-pow.f64N/A
lift-sin.f6451.6
Applied rewrites51.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1150000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.95e+77)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(pow (sin B) -1.0))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1150000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.95e+77) {
tmp = -((x * 1.0) / tan(B)) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1150000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.95e+77) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1150000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.95e+77], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1150000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{+77}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.15e6Initial program 57.9%
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 rewrites79.4%
if -1.15e6 < F < 1.9499999999999999e77Initial program 98.9%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.1
Applied rewrites99.1%
Taylor expanded in B around 0
lower-*.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-*.f64N/A
lift-fma.f6480.5
Applied rewrites80.5%
if 1.9499999999999999e77 < F Initial program 48.2%
Applied rewrites48.2%
lift-neg.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
inv-powN/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lower-/.f64N/A
lift-neg.f64N/A
lift-tan.f6448.2
Applied rewrites48.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6414.4
Applied rewrites14.4%
Taylor expanded in F around inf
inv-powN/A
lower-pow.f64N/A
lift-sin.f6451.6
Applied rewrites51.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1150000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.2e+75)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F B) (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1150000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.2e+75) {
tmp = -((x * 1.0) / tan(B)) + ((F / B) * (1.0 / sqrt((2.0 + fma(2.0, x, (F * F))))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1150000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.2e+75) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1150000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.2e+75], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $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] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1150000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+75}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.15e6Initial program 57.9%
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 rewrites79.4%
if -1.15e6 < F < 1.2e75Initial program 99.0%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.1
Applied rewrites99.1%
Taylor expanded in B around 0
lower-*.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-*.f64N/A
lift-fma.f6480.6
Applied rewrites80.6%
if 1.2e75 < F Initial program 48.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.3%
Taylor expanded in F around inf
Applied rewrites50.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1150000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.2e+75)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1150000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.2e+75) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1150000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.2e+75) tmp = Float64(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)))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1150000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.2e+75], 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], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1150000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+75}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.15e6Initial program 57.9%
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 rewrites79.4%
if -1.15e6 < F < 1.2e75Initial program 99.0%
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-*.f6480.5
Applied rewrites80.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6480.5
Applied rewrites80.5%
if 1.2e75 < F Initial program 48.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.3%
Taylor expanded in F around inf
Applied rewrites50.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F))))))
(t_1 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (/ -1.0 F)))))
(if (<= B 0.16)
(/
(-
(fma
F
t_0
(*
(* B B)
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
x)
B)
(if (<= B 3e+210)
t_1
(if (<= B 3.1e+243)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
double t_1 = -(x * (1.0 / tan(B))) + ((F / B) * (-1.0 / F));
double tmp;
if (B <= 0.16) {
tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
} else if (B <= 3e+210) {
tmp = t_1;
} else if (B <= 3.1e+243) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))) t_1 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * Float64(-1.0 / F))) tmp = 0.0 if (B <= 0.16) tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B); elseif (B <= 3e+210) tmp = t_1; elseif (B <= 3.1e+243) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = t_1; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.16], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 3e+210], t$95$1, If[LessEqual[B, 3.1e+243], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
t_1 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\\
\mathbf{if}\;B \leq 0.16:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
\mathbf{elif}\;B \leq 3 \cdot 10^{+210}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq 3.1 \cdot 10^{+243}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if B < 0.160000000000000003Initial program 73.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6473.6
Applied rewrites73.6%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
if 0.160000000000000003 < B < 3.00000000000000022e210 or 3.1e243 < B Initial program 86.4%
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-*.f6456.7
Applied rewrites56.7%
Taylor expanded in F around -inf
lower-/.f6454.2
Applied rewrites54.2%
if 3.00000000000000022e210 < B < 3.1e243Initial program 84.4%
Applied rewrites84.4%
lift-neg.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
inv-powN/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lower-/.f64N/A
lift-neg.f64N/A
lift-tan.f6484.6
Applied rewrites84.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6435.1
Applied rewrites35.1%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6435.1
Applied rewrites35.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F))))))
(t_1 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
(if (<= B 0.16)
(/
(-
(fma
F
t_0
(*
(* B B)
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
x)
B)
(if (<= B 2.4e+210)
t_1
(if (<= B 3.1e+243)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
double t_1 = -(x * (1.0 / tan(B))) + (-1.0 / B);
double tmp;
if (B <= 0.16) {
tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
} else if (B <= 2.4e+210) {
tmp = t_1;
} else if (B <= 3.1e+243) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))) t_1 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)) tmp = 0.0 if (B <= 0.16) tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B); elseif (B <= 2.4e+210) tmp = t_1; elseif (B <= 3.1e+243) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = t_1; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.16], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 2.4e+210], t$95$1, If[LessEqual[B, 3.1e+243], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
t_1 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\mathbf{if}\;B \leq 0.16:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{+210}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;B \leq 3.1 \cdot 10^{+243}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if B < 0.160000000000000003Initial program 73.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6473.6
Applied rewrites73.6%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
if 0.160000000000000003 < B < 2.39999999999999988e210 or 3.1e243 < B Initial program 86.4%
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-*.f6456.7
Applied rewrites56.7%
Taylor expanded in F around -inf
lower-/.f6451.0
Applied rewrites51.0%
if 2.39999999999999988e210 < B < 3.1e243Initial program 84.4%
Applied rewrites84.4%
lift-neg.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
inv-powN/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lower-/.f64N/A
lift-neg.f64N/A
lift-tan.f6484.6
Applied rewrites84.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6435.1
Applied rewrites35.1%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6435.1
Applied rewrites35.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(if (<= B 0.16)
(/
(-
(fma
F
t_0
(*
(* B B)
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
x)
B)
(+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
double tmp;
if (B <= 0.16) {
tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))) tmp = 0.0 if (B <= 0.16) tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.16], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{if}\;B \leq 0.16:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 0.160000000000000003Initial program 73.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6473.6
Applied rewrites73.6%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
Applied rewrites56.7%
if 0.160000000000000003 < B Initial program 86.2%
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-*.f6456.2
Applied rewrites56.2%
Taylor expanded in F around -inf
lower-/.f6450.9
Applied rewrites50.9%
(FPCore (F B x)
:precision binary64
(if (<= F -92000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 200000000.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -92000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 200000000.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -92000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 200000000.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(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -92000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 200000000.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[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -92000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -92000Initial 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 rewrites79.3%
if -92000 < F < 2e8Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6450.6
Applied rewrites50.6%
if 2e8 < F Initial program 57.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.0%
Taylor expanded in x around inf
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
sqrt-unprodN/A
lower-*.f64N/A
Applied rewrites9.7%
Taylor expanded in F around inf
+-commutativeN/A
*-commutativeN/A
div-addN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.8%
(FPCore (F B x)
:precision binary64
(if (<= F -300000.0)
(/ -1.0 (sin B))
(if (<= F 200000000.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -300000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 200000000.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -300000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 200000000.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(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -300000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 200000000.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[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -300000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -3e5Initial 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 x around 0
lower-/.f64N/A
lift-sin.f6455.7
Applied rewrites55.7%
if -3e5 < F < 2e8Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6450.7
Applied rewrites50.7%
if 2e8 < F Initial program 57.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.0%
Taylor expanded in x around inf
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
sqrt-unprodN/A
lower-*.f64N/A
Applied rewrites9.7%
Taylor expanded in F around inf
+-commutativeN/A
*-commutativeN/A
div-addN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
+-commutativeN/A
lower-fma.f64N/A
Applied rewrites50.8%
(FPCore (F B x)
:precision binary64
(if (<= F -4.6e+25)
(/
(-
(*
(* B B)
(fma
-0.16666666666666666
x
(-
(*
(* B B)
(-
(-
(fma
-0.16666666666666666
(* x -0.3333333333333333)
(* 0.008333333333333333 x))
0.019444444444444445)
(* 0.041666666666666664 x)))
(+ 0.16666666666666666 (* -0.5 x)))))
(+ 1.0 x))
B)
(if (<= F 9.5e-18)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e+25) {
tmp = (((B * B) * fma(-0.16666666666666666, x, (((B * B) * ((fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - 0.019444444444444445) - (0.041666666666666664 * x))) - (0.16666666666666666 + (-0.5 * x))))) - (1.0 + x)) / B;
} else if (F <= 9.5e-18) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.6e+25) tmp = Float64(Float64(Float64(Float64(B * B) * fma(-0.16666666666666666, x, Float64(Float64(Float64(B * B) * Float64(Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - 0.019444444444444445) - Float64(0.041666666666666664 * x))) - Float64(0.16666666666666666 + Float64(-0.5 * x))))) - Float64(1.0 + x)) / B); elseif (F <= 9.5e-18) 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) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.6e+25], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(-0.16666666666666666 * x + N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - 0.019444444444444445), $MachinePrecision] - N[(0.041666666666666664 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.16666666666666666 + N[(-0.5 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e-18], 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] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.6 \cdot 10^{+25}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \mathsf{fma}\left(-0.16666666666666666, x, \left(B \cdot B\right) \cdot \left(\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - 0.019444444444444445\right) - 0.041666666666666664 \cdot x\right) - \left(0.16666666666666666 + -0.5 \cdot x\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-18}:\\
\;\;\;\;\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}{B}\\
\end{array}
\end{array}
if F < -4.5999999999999996e25Initial program 55.9%
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
Applied rewrites51.4%
if -4.5999999999999996e25 < F < 9.5000000000000003e-18Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6450.7
Applied rewrites50.7%
if 9.5000000000000003e-18 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.7%
Taylor expanded in F around inf
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2.25e+18)
(-
(/
(+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
B))
(if (<= F 9.5e-18)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.25e+18) {
tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
} else if (F <= 9.5e-18) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.25e+18) tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B)); elseif (F <= 9.5e-18) 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) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.25e+18], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 9.5e-18], 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] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.25 \cdot 10^{+18}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-18}:\\
\;\;\;\;\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}{B}\\
\end{array}
\end{array}
if F < -2.25e18Initial program 56.7%
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
inv-powN/A
lower-pow.f64N/A
lift-sin.f6455.5
Applied rewrites55.5%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6451.7
Applied rewrites51.7%
if -2.25e18 < F < 9.5000000000000003e-18Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6450.6
Applied rewrites50.6%
if 9.5000000000000003e-18 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.7%
Taylor expanded in F around inf
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -3.3e+21)
(-
(/
(+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
B))
(if (<= F 620000000.0)
(/ (- (* (sqrt (/ 1.0 (+ (* x 2.0) 2.0))) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e+21) {
tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
} else if (F <= 620000000.0) {
tmp = ((sqrt((1.0 / ((x * 2.0) + 2.0))) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.3e+21) tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B)); elseif (F <= 620000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / Float64(Float64(x * 2.0) + 2.0))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.3e+21], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 620000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(N[(x * 2.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.3 \cdot 10^{+21}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
\mathbf{elif}\;F \leq 620000000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{x \cdot 2 + 2}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.3e21Initial program 56.4%
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
inv-powN/A
lower-pow.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6451.7
Applied rewrites51.7%
if -3.3e21 < F < 6.2e8Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in F around 0
lift-*.f6448.9
Applied rewrites48.9%
lift-pow.f64N/A
unpow-1N/A
lower-/.f6448.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6448.9
Applied rewrites48.9%
if 6.2e8 < F Initial program 57.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites35.9%
Taylor expanded in F around inf
Applied rewrites50.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.9e-79)
(-
(/
(+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
B))
(if (<= F 1.05e-20) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.9e-79) {
tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
} else if (F <= 1.05e-20) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.9e-79) tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B)); elseif (F <= 1.05e-20) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.9e-79], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 1.05e-20], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.9 \cdot 10^{-79}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-20}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.90000000000000006e-79Initial program 65.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.f6488.8
Applied rewrites88.8%
Taylor expanded in x around 0
inv-powN/A
lower-pow.f64N/A
lift-sin.f6447.1
Applied rewrites47.1%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6445.7
Applied rewrites45.7%
if -3.90000000000000006e-79 < F < 1.0499999999999999e-20Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.5%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6437.6
Applied rewrites37.6%
if 1.0499999999999999e-20 < F Initial program 60.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites49.2%
(FPCore (F B x) :precision binary64 (if (<= F -1.25e-88) (/ (- -1.0 x) B) (if (<= F 1.05e-20) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-88) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.05e-20) {
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 <= (-1.25d-88)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.05d-20) 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 <= -1.25e-88) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.05e-20) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e-88: tmp = (-1.0 - x) / B elif F <= 1.05e-20: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e-88) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.05e-20) 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 <= -1.25e-88) tmp = (-1.0 - x) / B; elseif (F <= 1.05e-20) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-88], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.05e-20], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-88}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-20}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.25000000000000002e-88Initial program 66.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.9%
Taylor expanded in F around -inf
Applied rewrites45.5%
if -1.25000000000000002e-88 < F < 1.0499999999999999e-20Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.5%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6437.6
Applied rewrites37.6%
if 1.0499999999999999e-20 < F Initial program 60.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites49.2%
(FPCore (F B x) :precision binary64 (if (<= F -1.25e-88) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-88) {
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 <= (-1.25d-88)) 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 <= -1.25e-88) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e-88: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e-88) 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 <= -1.25e-88) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-88], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-88}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.25000000000000002e-88Initial program 66.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.9%
Taylor expanded in F around -inf
Applied rewrites45.5%
if -1.25000000000000002e-88 < F Initial program 82.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites44.5%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6431.5
Applied rewrites31.5%
(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.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
mul-1-negN/A
lift-neg.f6429.0
Applied rewrites29.0%
herbie shell --seed 2025107
(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))))))