
(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 26 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 -250000000.0)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 210000000.0)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (/ (- x) (tan B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -250000000.0) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 210000000.0) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / tan(B)));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -250000000.0) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 210000000.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(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -250000000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 210000000.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[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -250000000:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 210000000:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.5e8Initial program 70.3%
Taylor expanded in F around -inf
mul-1-negN/A
div-add-revN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -2.5e8 < F < 2.1e8Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.6%
if 2.1e8 < F Initial program 64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
(t_1
(-
(* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B))
(/ x (tan B)))))
(if (<= t_0 -2e+20)
t_1
(if (<= t_0 10.0)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
(if (<= t_0 2e+282)
t_1
(+
(/
(-
(*
(fma
(fma
x
0.022222222222222223
(*
(fma
(* x 0.022222222222222223)
-0.3333333333333333
(* x 0.009523809523809525))
(* B B)))
(* B B)
(* 0.3333333333333333 x))
(* B B))
x)
B)
(/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double t_1 = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
double tmp;
if (t_0 <= -2e+20) {
tmp = t_1;
} else if (t_0 <= 10.0) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else if (t_0 <= 2e+282) {
tmp = t_1;
} else {
tmp = (((fma(fma(x, 0.022222222222222223, (fma((x * 0.022222222222222223), -0.3333333333333333, (x * 0.009523809523809525)) * (B * B))), (B * B), (0.3333333333333333 * x)) * (B * B)) - x) / B) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = 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(-1.0 / 2.0)))) t_1 = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B))) tmp = 0.0 if (t_0 <= -2e+20) tmp = t_1; elseif (t_0 <= 10.0) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); elseif (t_0 <= 2e+282) tmp = t_1; else tmp = Float64(Float64(Float64(Float64(fma(fma(x, 0.022222222222222223, Float64(fma(Float64(x * 0.022222222222222223), -0.3333333333333333, Float64(x * 0.009523809523809525)) * Float64(B * B))), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B)) - x) / B) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+20], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], t$95$1, N[(N[(N[(N[(N[(N[(x * 0.022222222222222223 + N[(N[(N[(x * 0.022222222222222223), $MachinePrecision] * -0.3333333333333333 + N[(x * 0.009523809523809525), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e20 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2.00000000000000007e282Initial program 97.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6497.4
Applied rewrites97.6%
Applied rewrites99.0%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
if -2e20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10Initial program 79.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6479.2
Applied rewrites79.2%
Applied rewrites79.3%
Taylor expanded in B around 0
lower-/.f6460.6
Applied rewrites60.6%
if 2.00000000000000007e282 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 28.7%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites66.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites66.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6482.9
Applied rewrites82.9%
Final simplification82.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
(t_1
(-
(* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B))
(/ x (tan B)))))
(if (<= t_0 -2e+20)
t_1
(if (<= t_0 10.0)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
(if (<= t_0 2e+282) t_1 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double t_1 = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
double tmp;
if (t_0 <= -2e+20) {
tmp = t_1;
} else if (t_0 <= 10.0) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else if (t_0 <= 2e+282) {
tmp = t_1;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = 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(-1.0 / 2.0)))) t_1 = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B))) tmp = 0.0 if (t_0 <= -2e+20) tmp = t_1; elseif (t_0 <= 10.0) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); elseif (t_0 <= 2e+282) tmp = t_1; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+20], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e20 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2.00000000000000007e282Initial program 97.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6497.4
Applied rewrites97.6%
Applied rewrites99.0%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
if -2e20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10Initial program 79.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6479.2
Applied rewrites79.2%
Applied rewrites79.3%
Taylor expanded in B around 0
lower-/.f6460.6
Applied rewrites60.6%
if 2.00000000000000007e282 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 28.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6466.7
Applied rewrites66.7%
Taylor expanded in F around inf
Applied rewrites82.9%
Final simplification82.5%
(FPCore (F B x)
:precision binary64
(if (<= F -250000000.0)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 210000000.0)
(fma (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)) (/ (- x) (tan B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -250000000.0) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 210000000.0) {
tmp = fma(sqrt((1.0 / fma(F, F, 2.0))), (F / sin(B)), (-x / tan(B)));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -250000000.0) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 210000000.0) tmp = fma(sqrt(Float64(1.0 / fma(F, F, 2.0))), Float64(F / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -250000000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 210000000.0], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -250000000:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 210000000:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.5e8Initial program 70.3%
Taylor expanded in F around -inf
mul-1-negN/A
div-add-revN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -2.5e8 < F < 2.1e8Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
if 2.1e8 < F Initial program 64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+30)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 50000000.0)
(- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B))) (/ x (tan B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+30) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 50000000.0) {
tmp = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))) - (x / tan(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+30) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 50000000.0) tmp = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))) - Float64(x / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+30], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 50000000.0], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+30}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 50000000:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -4.9999999999999998e30Initial program 68.1%
Taylor expanded in F around -inf
mul-1-negN/A
div-add-revN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -4.9999999999999998e30 < F < 5e7Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.4
Applied rewrites99.6%
Applied rewrites99.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lift-fma.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lower-fma.f6499.6
Applied rewrites99.6%
if 5e7 < F Initial program 64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-5)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 3.5e-185)
(- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
(if (<= F 2.3e-9)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (- (/ x B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-5) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 3.5e-185) {
tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
} else if (F <= 2.3e-9) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), -(x / B));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 3.5e-185) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 2.3e-9) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(-Float64(x / B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-9], 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 / B), $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;\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}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
Taylor expanded in F around -inf
mul-1-negN/A
div-add-revN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6497.5
Applied rewrites97.5%
if -9.00000000000000057e-5 < F < 3.4999999999999998e-185Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6488.6
Applied rewrites88.6%
if 3.4999999999999998e-185 < F < 2.2999999999999999e-9Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6486.1
Applied rewrites86.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites86.1%
if 2.2999999999999999e-9 < F Initial program 66.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.3
Applied rewrites99.3%
Final simplification94.1%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-5)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 3.5e-185)
(- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
(if (<= F 2.3e-9)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-5) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 3.5e-185) {
tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
} else if (F <= 2.3e-9) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 3.5e-185) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 2.3e-9) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
Taylor expanded in F around -inf
mul-1-negN/A
div-add-revN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6497.5
Applied rewrites97.5%
if -9.00000000000000057e-5 < F < 3.4999999999999998e-185Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6488.6
Applied rewrites88.6%
if 3.4999999999999998e-185 < F < 2.2999999999999999e-9Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6486.0
Applied rewrites86.0%
if 2.2999999999999999e-9 < F Initial program 66.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.3
Applied rewrites99.3%
Final simplification94.1%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-5)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 3.5e-185)
(- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
(if (<= F 2.3e-9)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
(/ (fma -1.0 (* (cos B) x) 1.0) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-5) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 3.5e-185) {
tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
} else if (F <= 2.3e-9) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = fma(-1.0, (cos(B) * x), 1.0) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 3.5e-185) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 2.3e-9) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = Float64(fma(-1.0, Float64(cos(B) * x), 1.0) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
Taylor expanded in F around -inf
mul-1-negN/A
div-add-revN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6497.5
Applied rewrites97.5%
if -9.00000000000000057e-5 < F < 3.4999999999999998e-185Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6488.6
Applied rewrites88.6%
if 3.4999999999999998e-185 < F < 2.2999999999999999e-9Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6486.0
Applied rewrites86.0%
if 2.2999999999999999e-9 < F Initial program 66.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6466.1
Applied rewrites66.2%
Taylor expanded in F around inf
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.2
Applied rewrites99.2%
Final simplification94.1%
(FPCore (F B x) :precision binary64 (if (or (<= x -6.5e+24) (not (<= x 3.6e-6))) (* (- x) (/ (cos B) (sin B))) (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -6.5e+24) || !(x <= 3.6e-6)) {
tmp = -x * (cos(B) / sin(B));
} else {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -6.5e+24) || !(x <= 3.6e-6)) tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B))); else tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -6.5e+24], N[Not[LessEqual[x, 3.6e-6]], $MachinePrecision]], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+24} \lor \neg \left(x \leq 3.6 \cdot 10^{-6}\right):\\
\;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if x < -6.4999999999999996e24 or 3.59999999999999984e-6 < x Initial program 87.0%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6498.6
Applied rewrites98.6%
if -6.4999999999999996e24 < x < 3.59999999999999984e-6Initial program 78.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6478.0
Applied rewrites78.0%
Applied rewrites80.1%
Taylor expanded in B around 0
lower-/.f6469.7
Applied rewrites69.7%
Final simplification81.4%
(FPCore (F B x)
:precision binary64
(if (<= x -6.5e+24)
(* (- x) (/ (cos B) (sin B)))
(if (<= x 3.6e-6)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
(/ (* (cos B) x) (- (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -6.5e+24) {
tmp = -x * (cos(B) / sin(B));
} else if (x <= 3.6e-6) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = (cos(B) * x) / -sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -6.5e+24) tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B))); elseif (x <= 3.6e-6) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(cos(B) * x) / Float64(-sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -6.5e+24], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6e-6], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+24}:\\
\;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos B \cdot x}{-\sin B}\\
\end{array}
\end{array}
if x < -6.4999999999999996e24Initial program 70.4%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6499.5
Applied rewrites99.5%
if -6.4999999999999996e24 < x < 3.59999999999999984e-6Initial program 78.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6478.0
Applied rewrites78.0%
Applied rewrites80.1%
Taylor expanded in B around 0
lower-/.f6469.7
Applied rewrites69.7%
if 3.59999999999999984e-6 < x Initial program 92.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6498.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6498.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6498.4
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval98.4
Applied rewrites98.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6496.3
Applied rewrites96.3%
Taylor expanded in x around inf
Applied rewrites98.5%
Final simplification81.4%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-5)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 3.5e-185)
(- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
(if (<= F 2.5e+154)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
(+
(* x (/ -1.0 (tan B)))
(/ (fma (* B B) 0.16666666666666666 1.0) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-5) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 3.5e-185) {
tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
} else if (F <= 2.5e+154) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = (x * (-1.0 / tan(B))) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 3.5e-185) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 2.5e+154) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e+154], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
Taylor expanded in F around -inf
mul-1-negN/A
div-add-revN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6497.5
Applied rewrites97.5%
if -9.00000000000000057e-5 < F < 3.4999999999999998e-185Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6488.6
Applied rewrites88.6%
if 3.4999999999999998e-185 < F < 2.50000000000000002e154Initial program 94.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6494.1
Applied rewrites94.1%
Applied rewrites98.3%
Taylor expanded in B around 0
lower-/.f6481.4
Applied rewrites81.4%
if 2.50000000000000002e154 < F Initial program 37.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites23.9%
Taylor expanded in F around inf
Applied rewrites61.1%
Final simplification85.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+35)
(/ (+ 1.0 x) (- (sin B)))
(if (<= F 2.5e+154)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
(+ (* x (/ -1.0 (tan B))) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+35) {
tmp = (1.0 + x) / -sin(B);
} else if (F <= 2.5e+154) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = (x * (-1.0 / tan(B))) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+35) tmp = Float64(Float64(1.0 + x) / Float64(-sin(B))); elseif (F <= 2.5e+154) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+35], N[(N[(1.0 + x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 2.5e+154], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+35}:\\
\;\;\;\;\frac{1 + x}{-\sin B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -9.9999999999999997e34Initial program 66.6%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6476.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6476.4
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval76.4
Applied rewrites76.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites76.8%
if -9.9999999999999997e34 < F < 2.50000000000000002e154Initial program 97.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6497.1
Applied rewrites97.2%
Applied rewrites99.1%
Taylor expanded in B around 0
lower-/.f6476.4
Applied rewrites76.4%
if 2.50000000000000002e154 < F Initial program 37.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites23.9%
Taylor expanded in F around inf
Applied rewrites61.1%
Final simplification74.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
(if (<= F -9e-5)
(/ (+ 1.0 x) (- (sin B)))
(if (<= F 4.25e-162)
(/
(fma
t_0
F
(-
(*
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B))
x))
B)
(if (<= F 2.2e-9)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
(+
(* x (/ -1.0 (tan B)))
(/ (fma (* B B) 0.16666666666666666 1.0) B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double tmp;
if (F <= -9e-5) {
tmp = (1.0 + x) / -sin(B);
} else if (F <= 4.25e-162) {
tmp = fma(t_0, F, ((fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)) * (B * B)) - x)) / B;
} else if (F <= 2.2e-9) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(1.0 + x) / Float64(-sin(B))); elseif (F <= 4.25e-162) tmp = Float64(fma(t_0, F, Float64(Float64(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)) * Float64(B * B)) - x)) / B); elseif (F <= 2.2e-9) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -9e-5], N[(N[(1.0 + x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 4.25e-162], N[(N[(t$95$0 * F + N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e-9], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{1 + x}{-\sin B}\\
\mathbf{elif}\;F \leq 4.25 \cdot 10^{-162}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{-9}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6480.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6480.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6480.4
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval80.4
Applied rewrites80.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6497.5
Applied rewrites97.5%
Taylor expanded in B around 0
Applied rewrites75.4%
if -9.00000000000000057e-5 < F < 4.24999999999999977e-162Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.6
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6499.6
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval99.6
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites62.6%
if 4.24999999999999977e-162 < F < 2.1999999999999998e-9Initial program 99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6470.8
Applied rewrites70.8%
if 2.1999999999999998e-9 < F Initial program 66.1%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites45.8%
Taylor expanded in F around inf
Applied rewrites62.4%
Final simplification67.1%
(FPCore (F B x)
:precision binary64
(if (<= B 1.25)
(+
(/
(-
(*
(fma
(fma
x
0.022222222222222223
(*
(fma
(* x 0.022222222222222223)
-0.3333333333333333
(* x 0.009523809523809525))
(* B B)))
(* B B)
(* 0.3333333333333333 x))
(* B B))
x)
B)
(/
(*
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* 0.16666666666666666 F) (* B B) F))
B))
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.25) {
tmp = (((fma(fma(x, 0.022222222222222223, (fma((x * 0.022222222222222223), -0.3333333333333333, (x * 0.009523809523809525)) * (B * B))), (B * B), (0.3333333333333333 * x)) * (B * B)) - x) / B) + ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma((0.16666666666666666 * F), (B * B), F)) / B);
} else {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 1.25) tmp = Float64(Float64(Float64(Float64(fma(fma(x, 0.022222222222222223, Float64(fma(Float64(x * 0.022222222222222223), -0.3333333333333333, Float64(x * 0.009523809523809525)) * Float64(B * B))), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B)) - x) / B) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B)); else tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 1.25], N[(N[(N[(N[(N[(N[(x * 0.022222222222222223 + N[(N[(N[(x * 0.022222222222222223), $MachinePrecision] * -0.3333333333333333 + N[(x * 0.009523809523809525), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.25:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\end{array}
\end{array}
if B < 1.25Initial program 79.6%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites64.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites61.2%
if 1.25 < B Initial program 88.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6432.2
Applied rewrites32.2%
Final simplification54.4%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-5)
(/ (+ 1.0 x) (- (sin B)))
(if (<= F 185000000.0)
(+
(- (/ x B))
(/
(*
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* 0.16666666666666666 F) (* B B) F))
B))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-5) {
tmp = (1.0 + x) / -sin(B);
} else if (F <= 185000000.0) {
tmp = -(x / B) + ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma((0.16666666666666666 * F), (B * B), F)) / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(1.0 + x) / Float64(-sin(B))); elseif (F <= 185000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[(N[(1.0 + x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 185000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{1 + x}{-\sin B}\\
\mathbf{elif}\;F \leq 185000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6480.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6480.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6480.4
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval80.4
Applied rewrites80.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
+-commutativeN/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-sin.f6497.5
Applied rewrites97.5%
Taylor expanded in B around 0
Applied rewrites75.4%
if -9.00000000000000057e-5 < F < 1.85e8Initial program 99.4%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites65.4%
Taylor expanded in B around 0
lower-/.f6458.3
Applied rewrites58.3%
if 1.85e8 < F Initial program 64.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites52.6%
Final simplification61.7%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-5)
(/ (- (- (* (/ 0.5 F) (/ (fma 2.0 x 2.0) F)) 1.0) x) B)
(if (<= F 185000000.0)
(+
(- (/ x B))
(/
(*
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* 0.16666666666666666 F) (* B B) F))
B))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-5) {
tmp = ((((0.5 / F) * (fma(2.0, x, 2.0) / F)) - 1.0) - x) / B;
} else if (F <= 185000000.0) {
tmp = -(x / B) + ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma((0.16666666666666666 * F), (B * B), F)) / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(Float64(Float64(Float64(0.5 / F) * Float64(fma(2.0, x, 2.0) / F)) - 1.0) - x) / B); elseif (F <= 185000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[(N[(N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 185000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 185000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6441.8
Applied rewrites41.8%
Taylor expanded in F around -inf
Applied rewrites52.2%
if -9.00000000000000057e-5 < F < 1.85e8Initial program 99.4%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites65.4%
Taylor expanded in B around 0
lower-/.f6458.3
Applied rewrites58.3%
if 1.85e8 < F Initial program 64.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites52.6%
Final simplification54.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) B)))
(if (<= F -1350000.0)
(/ (- -1.0 x) B)
(if (<= F -3.5e-35)
t_0
(if (<= F 1.5e-152)
(/ (- x) B)
(if (<= F 10800.0) t_0 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = (sqrt((1.0 / fma(F, F, 2.0))) * F) / B;
double tmp;
if (F <= -1350000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= -3.5e-35) {
tmp = t_0;
} else if (F <= 1.5e-152) {
tmp = -x / B;
} else if (F <= 10800.0) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / B) tmp = 0.0 if (F <= -1350000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -3.5e-35) tmp = t_0; elseif (F <= 1.5e-152) tmp = Float64(Float64(-x) / B); elseif (F <= 10800.0) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -1350000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3.5e-35], t$95$0, If[LessEqual[F, 1.5e-152], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 10800.0], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\
\mathbf{if}\;F \leq -1350000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 10800:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.35e6Initial program 70.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6442.7
Applied rewrites42.7%
Taylor expanded in F around -inf
Applied rewrites53.6%
if -1.35e6 < F < -3.49999999999999996e-35 or 1.5e-152 < F < 10800Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6452.0
Applied rewrites52.0%
Taylor expanded in x around 0
Applied rewrites43.5%
if -3.49999999999999996e-35 < F < 1.5e-152Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6459.1
Applied rewrites59.1%
Taylor expanded in F around 0
Applied rewrites47.7%
if 10800 < F Initial program 64.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites52.6%
Final simplification50.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F B))))
(if (<= F -1350000.0)
(/ (- -1.0 x) B)
(if (<= F -3.5e-35)
t_0
(if (<= F 1.5e-152)
(/ (- x) B)
(if (<= F 10800.0) t_0 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(F, F, 2.0))) * (F / B);
double tmp;
if (F <= -1350000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= -3.5e-35) {
tmp = t_0;
} else if (F <= 1.5e-152) {
tmp = -x / B;
} else if (F <= 10800.0) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / B)) tmp = 0.0 if (F <= -1350000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -3.5e-35) tmp = t_0; elseif (F <= 1.5e-152) tmp = Float64(Float64(-x) / B); elseif (F <= 10800.0) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1350000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3.5e-35], t$95$0, If[LessEqual[F, 1.5e-152], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 10800.0], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\
\mathbf{if}\;F \leq -1350000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 10800:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.35e6Initial program 70.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6442.7
Applied rewrites42.7%
Taylor expanded in F around -inf
Applied rewrites53.6%
if -1.35e6 < F < -3.49999999999999996e-35 or 1.5e-152 < F < 10800Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6452.0
Applied rewrites52.0%
Taylor expanded in x around 0
Applied rewrites43.4%
if -3.49999999999999996e-35 < F < 1.5e-152Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6459.1
Applied rewrites59.1%
Taylor expanded in F around 0
Applied rewrites47.7%
if 10800 < F Initial program 64.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites52.6%
Final simplification50.2%
(FPCore (F B x)
:precision binary64
(if (<= F -9e-5)
(/ (- (- (* (/ 0.5 F) (/ (fma 2.0 x 2.0) F)) 1.0) x) B)
(if (<= F 10000.0)
(/ (- (* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-5) {
tmp = ((((0.5 / F) * (fma(2.0, x, 2.0) / F)) - 1.0) - x) / B;
} else if (F <= 10000.0) {
tmp = ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(Float64(Float64(Float64(0.5 / F) * Float64(fma(2.0, x, 2.0) / F)) - 1.0) - x) / B); elseif (F <= 10000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[(N[(N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 10000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 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 -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 10000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6441.8
Applied rewrites41.8%
Taylor expanded in F around -inf
Applied rewrites52.2%
if -9.00000000000000057e-5 < F < 1e4Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6458.0
Applied rewrites58.0%
if 1e4 < F Initial program 64.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites52.6%
Final simplification54.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (fma 2.0 x 2.0) F)))
(if (<= F -9e-5)
(/ (- (- (* (/ 0.5 F) t_0) 1.0) x) B)
(if (<= F 2.3e-9)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
(/ (- (fma (/ -0.5 F) t_0 1.0) x) B)))))
double code(double F, double B, double x) {
double t_0 = fma(2.0, x, 2.0) / F;
double tmp;
if (F <= -9e-5) {
tmp = ((((0.5 / F) * t_0) - 1.0) - x) / B;
} else if (F <= 2.3e-9) {
tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (fma((-0.5 / F), t_0, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(fma(2.0, x, 2.0) / F) tmp = 0.0 if (F <= -9e-5) tmp = Float64(Float64(Float64(Float64(Float64(0.5 / F) * t_0) - 1.0) - x) / B); elseif (F <= 2.3e-9) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(fma(Float64(-0.5 / F), t_0, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision]}, If[LessEqual[F, -9e-5], N[(N[(N[(N[(N[(0.5 / F), $MachinePrecision] * t$95$0), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(2, x, 2\right)}{F}\\
\mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
\;\;\;\;\frac{\left(\frac{0.5}{F} \cdot t\_0 - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, t\_0, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000057e-5Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6441.8
Applied rewrites41.8%
Taylor expanded in F around -inf
Applied rewrites52.2%
if -9.00000000000000057e-5 < F < 2.2999999999999999e-9Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6458.6
Applied rewrites58.6%
Taylor expanded in F around 0
Applied rewrites58.3%
if 2.2999999999999999e-9 < F Initial program 66.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites52.0%
Final simplification54.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.9)
(/ (- -1.0 x) B)
(if (<= F 2.3e-9)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
(/ (- (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.9) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.3e-9) {
tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (fma((-0.5 / F), (fma(2.0, x, 2.0) / F), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.9) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.3e-9) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.9], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.9:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.8999999999999999Initial program 71.9%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6442.3
Applied rewrites42.3%
Taylor expanded in F around -inf
Applied rewrites52.6%
if -1.8999999999999999 < F < 2.2999999999999999e-9Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6458.0
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites57.8%
if 2.2999999999999999e-9 < F Initial program 66.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites52.0%
Final simplification54.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.9)
(/ (- -1.0 x) B)
(if (<= F 2.3e-9)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.9) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.3e-9) {
tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.9) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.3e-9) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.9], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 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 -1.9:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.8999999999999999Initial program 71.9%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6442.3
Applied rewrites42.3%
Taylor expanded in F around -inf
Applied rewrites52.6%
if -1.8999999999999999 < F < 2.2999999999999999e-9Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6458.0
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites57.8%
if 2.2999999999999999e-9 < F Initial program 66.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites51.5%
Final simplification54.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.6e-59)
(/ (- -1.0 x) B)
(if (<= F 2.1e-114)
(/ (- (fma (* -0.3333333333333333 x) (* B B) x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e-59) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.1e-114) {
tmp = -fma((-0.3333333333333333 * x), (B * B), x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.6e-59) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.1e-114) tmp = Float64(Float64(-fma(Float64(-0.3333333333333333 * x), Float64(B * B), x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.6e-59], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.1e-114], N[((-N[(N[(-0.3333333333333333 * x), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision]) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-114}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.6e-59Initial program 75.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6444.6
Applied rewrites44.6%
Taylor expanded in F around -inf
Applied rewrites48.3%
if -1.6e-59 < F < 2.09999999999999993e-114Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.7%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6471.9
Applied rewrites71.9%
Taylor expanded in B around 0
Applied rewrites46.2%
if 2.09999999999999993e-114 < F Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6441.1
Applied rewrites41.1%
Taylor expanded in F around inf
Applied rewrites45.2%
Final simplification46.5%
(FPCore (F B x) :precision binary64 (if (<= F -1.5e-65) (/ (- -1.0 x) B) (if (<= F 5.6e-50) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-65) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.6e-50) {
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.5d-65)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 5.6d-50) 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.5e-65) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.6e-50) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.5e-65: tmp = (-1.0 - x) / B elif F <= 5.6e-50: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-65) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 5.6e-50) 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.5e-65) tmp = (-1.0 - x) / B; elseif (F <= 5.6e-50) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-65], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.6e-50], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-50}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.49999999999999999e-65Initial program 75.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6444.1
Applied rewrites44.1%
Taylor expanded in F around -inf
Applied rewrites47.8%
if -1.49999999999999999e-65 < F < 5.5999999999999996e-50Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6457.1
Applied rewrites57.1%
Taylor expanded in F around 0
Applied rewrites43.9%
if 5.5999999999999996e-50 < F Initial program 68.9%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6442.1
Applied rewrites42.1%
Taylor expanded in F around inf
Applied rewrites47.9%
Final simplification46.5%
(FPCore (F B x) :precision binary64 (if (<= F -1.5e-65) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-65) {
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.5d-65)) 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.5e-65) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.5e-65: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-65) 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.5e-65) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-65], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.49999999999999999e-65Initial program 75.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6444.1
Applied rewrites44.1%
Taylor expanded in F around -inf
Applied rewrites47.8%
if -1.49999999999999999e-65 < F Initial program 84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6449.8
Applied rewrites49.8%
Taylor expanded in F around 0
Applied rewrites33.3%
Final simplification38.1%
(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 81.6%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6447.9
Applied rewrites47.9%
Taylor expanded in F around 0
Applied rewrites29.3%
Final simplification29.3%
herbie shell --seed 2025015
(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))))))