
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Herbie found 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.25)) (t_1 (* (cos B) x)))
(if (<= F -120000.0)
(-
(/ (* 0.5 (fma 2.0 x 2.0)) (* (* F F) (sin B)))
(/ (+ 1.0 t_1) (sin B)))
(if (<= F 1.95e-8)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (* t_0 t_0)))
(/ (- 1.0 t_1) (sin B))))))
double code(double F, double B, double x) {
double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.25);
double t_1 = cos(B) * x;
double tmp;
if (F <= -120000.0) {
tmp = ((0.5 * fma(2.0, x, 2.0)) / ((F * F) * sin(B))) - ((1.0 + t_1) / sin(B));
} else if (F <= 1.95e-8) {
tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * (t_0 * t_0));
} else {
tmp = (1.0 - t_1) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.25 t_1 = Float64(cos(B) * x) tmp = 0.0 if (F <= -120000.0) tmp = Float64(Float64(Float64(0.5 * fma(2.0, x, 2.0)) / Float64(Float64(F * F) * sin(B))) - Float64(Float64(1.0 + t_1) / sin(B))); elseif (F <= 1.95e-8) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * Float64(t_0 * t_0))); else tmp = Float64(Float64(1.0 - t_1) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.25], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -120000.0], N[(N[(N[(0.5 * N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 + t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.25}\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -120000:\\
\;\;\;\;\frac{0.5 \cdot \mathsf{fma}\left(2, x, 2\right)}{\left(F \cdot F\right) \cdot \sin B} - \frac{1 + t\_1}{\sin B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left(t\_0 \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_1}{\sin B}\\
\end{array}
\end{array}
if F < -1.2e5Initial program 59.2%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
Applied rewrites98.7%
if -1.2e5 < F < 1.94999999999999992e-8Initial program 99.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
sqr-powN/A
lower-*.f64N/A
Applied rewrites99.4%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -120000.0)
(-
(/ (* 0.5 (fma 2.0 x 2.0)) (* (* F F) (sin B)))
(/ (+ 1.0 t_0) (sin B)))
(if (<= F 1.95e-8)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))) (/ F (sin B))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -120000.0) {
tmp = ((0.5 * fma(2.0, x, 2.0)) / ((F * F) * sin(B))) - ((1.0 + t_0) / sin(B));
} else if (F <= 1.95e-8) {
tmp = -(x * (1.0 / tan(B))) + ((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * (F / sin(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -120000.0) tmp = Float64(Float64(Float64(0.5 * fma(2.0, x, 2.0)) / Float64(Float64(F * F) * sin(B))) - Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 1.95e-8) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * Float64(F / sin(B)))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -120000.0], N[(N[(N[(0.5 * N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -120000:\\
\;\;\;\;\frac{0.5 \cdot \mathsf{fma}\left(2, x, 2\right)}{\left(F \cdot F\right) \cdot \sin B} - \frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1.2e5Initial program 59.2%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
Applied rewrites98.7%
if -1.2e5 < F < 1.94999999999999992e-8Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
(FPCore (F B x)
:precision binary64
(if (<= F -4e+33)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 1.95e-8)
(+
(- (* x (/ 1.0 (tan B))))
(/ (* F 1.0) (* (sin B) (sqrt (fma F F (fma 2.0 x 2.0))))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e+33) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 1.95e-8) {
tmp = -(x * (1.0 / tan(B))) + ((F * 1.0) / (sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e+33) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 1.95e-8) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * 1.0) / Float64(sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e+33], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+33}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -3.9999999999999998e33Initial program 55.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
metadata-eval99.7
metadata-eval99.7
associate-*l/99.7
+-commutative99.7
lift-neg.f64N/A
lift-/.f64N/A
Applied rewrites99.7%
if -3.9999999999999998e33 < F < 1.94999999999999992e-8Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
*-commutativeN/A
pow2N/A
associate-+r+N/A
+-commutativeN/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites99.5%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma 2.0 x (fma F F 2.0))))
(if (<= F -4e+20)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 1.25e-132)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ 1.0 (sqrt t_0)) (/ F B)))
(if (<= F 1.95e-8)
(+ (- (/ x B)) (* F (/ (pow t_0 -0.5) (sin B))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -4e+20) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 1.25e-132) {
tmp = -(x * (1.0 / tan(B))) + ((1.0 / sqrt(t_0)) * (F / B));
} else if (F <= 1.95e-8) {
tmp = -(x / B) + (F * (pow(t_0, -0.5) / sin(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -4e+20) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 1.25e-132) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(1.0 / sqrt(t_0)) * Float64(F / B))); elseif (F <= 1.95e-8) tmp = Float64(Float64(-Float64(x / B)) + Float64(F * Float64((t_0 ^ -0.5) / sin(B)))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+20], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.25e-132], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(1.0 / N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x / B), $MachinePrecision]) + N[(F * N[(N[Power[t$95$0, -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{-132}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{t\_0}} \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + F \cdot \frac{{t\_0}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -4e20Initial program 57.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
metadata-eval99.7
metadata-eval99.7
associate-*l/99.7
+-commutative99.7
lift-neg.f64N/A
lift-/.f64N/A
Applied rewrites99.7%
if -4e20 < F < 1.25e-132Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites84.6%
if 1.25e-132 < F < 1.94999999999999992e-8Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
lower-/.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
lower-/.f6477.6
Applied rewrites77.6%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= F -4e+20)
(/ (- (fma (cos B) x 1.0)) (sin B))
(if (<= F 1.1e-132)
(+ (- (* x (/ 1.0 (tan B)))) (* t_0 (/ F B)))
(if (<= F 1.95e-8)
(+ (- (/ x B)) (* t_0 (/ F (sin B))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -4e+20) {
tmp = -fma(cos(B), x, 1.0) / sin(B);
} else if (F <= 1.1e-132) {
tmp = -(x * (1.0 / tan(B))) + (t_0 * (F / B));
} else if (F <= 1.95e-8) {
tmp = -(x / B) + (t_0 * (F / sin(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) tmp = 0.0 if (F <= -4e+20) tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B)); elseif (F <= 1.1e-132) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(t_0 * Float64(F / B))); elseif (F <= 1.95e-8) tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B)))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+20], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-132], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + t\_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -4e20Initial program 57.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
metadata-eval99.7
metadata-eval99.7
associate-*l/99.7
+-commutative99.7
lift-neg.f64N/A
lift-/.f64N/A
Applied rewrites99.7%
if -4e20 < F < 1.09999999999999995e-132Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites84.6%
if 1.09999999999999995e-132 < F < 1.94999999999999992e-8Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6477.5
Applied rewrites77.5%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))))
(t_1 (- (* x (/ 1.0 (tan B))))))
(if (<= F -5e+21)
(+ t_1 (/ -1.0 B))
(if (<= F 1.1e-132)
(+ t_1 (* t_0 (/ F B)))
(if (<= F 1.95e-8)
(+ (- (/ x B)) (* t_0 (/ F (sin B))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double t_1 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -5e+21) {
tmp = t_1 + (-1.0 / B);
} else if (F <= 1.1e-132) {
tmp = t_1 + (t_0 * (F / B));
} else if (F <= 1.95e-8) {
tmp = -(x / B) + (t_0 * (F / sin(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) t_1 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -5e+21) tmp = Float64(t_1 + Float64(-1.0 / B)); elseif (F <= 1.1e-132) tmp = Float64(t_1 + Float64(t_0 * Float64(F / B))); elseif (F <= 1.95e-8) tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B)))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -5e+21], N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-132], N[(t$95$1 + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
t_1 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\
\;\;\;\;t\_1 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
\;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -5e21Initial program 57.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.8
Applied rewrites44.8%
Taylor expanded in F around -inf
lower-/.f6473.3
Applied rewrites73.3%
if -5e21 < F < 1.09999999999999995e-132Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
Applied rewrites84.5%
if 1.09999999999999995e-132 < F < 1.94999999999999992e-8Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6477.5
Applied rewrites77.5%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))))
(t_1 (- (* x (/ 1.0 (tan B))))))
(if (<= F -5e+21)
(+ t_1 (/ -1.0 B))
(if (<= F 1.1e-132)
(+ t_1 (* t_0 (/ F B)))
(if (<= F 2.65e+137)
(+ (- (/ x B)) (* t_0 (/ F (sin B))))
(- (/ (* (cos B) x) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double t_1 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -5e+21) {
tmp = t_1 + (-1.0 / B);
} else if (F <= 1.1e-132) {
tmp = t_1 + (t_0 * (F / B));
} else if (F <= 2.65e+137) {
tmp = -(x / B) + (t_0 * (F / sin(B)));
} else {
tmp = -((cos(B) * x) / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) t_1 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -5e+21) tmp = Float64(t_1 + Float64(-1.0 / B)); elseif (F <= 1.1e-132) tmp = Float64(t_1 + Float64(t_0 * Float64(F / B))); elseif (F <= 2.65e+137) tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B)))); else tmp = Float64(-Float64(Float64(cos(B) * x) / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -5e+21], N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-132], N[(t$95$1 + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+137], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
t_1 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\
\;\;\;\;t\_1 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
\;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -5e21Initial program 57.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6444.8
Applied rewrites44.8%
Taylor expanded in F around -inf
lower-/.f6473.3
Applied rewrites73.3%
if -5e21 < F < 1.09999999999999995e-132Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
Applied rewrites84.5%
if 1.09999999999999995e-132 < F < 2.64999999999999984e137Initial program 94.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.1%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites94.0%
Taylor expanded in B around 0
lower-/.f6474.0
Applied rewrites74.0%
if 2.64999999999999984e137 < F Initial program 37.1%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6450.4
Applied rewrites50.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))))
(t_1 (- (* x (/ 1.0 (tan B)))))
(t_2 (+ t_1 (/ -1.0 B))))
(if (<= F -5e+21)
t_2
(if (<= F 1.1e-132)
(+ t_1 (* t_0 (/ F B)))
(if (<= F 2.65e+137)
(+ (- (/ x B)) (* t_0 (/ F (sin B))))
(if (<= F 1.4e+185) t_2 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)));
double t_1 = -(x * (1.0 / tan(B)));
double t_2 = t_1 + (-1.0 / B);
double tmp;
if (F <= -5e+21) {
tmp = t_2;
} else if (F <= 1.1e-132) {
tmp = t_1 + (t_0 * (F / B));
} else if (F <= 2.65e+137) {
tmp = -(x / B) + (t_0 * (F / sin(B)));
} else if (F <= 1.4e+185) {
tmp = t_2;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) t_1 = Float64(-Float64(x * Float64(1.0 / tan(B)))) t_2 = Float64(t_1 + Float64(-1.0 / B)) tmp = 0.0 if (F <= -5e+21) tmp = t_2; elseif (F <= 1.1e-132) tmp = Float64(t_1 + Float64(t_0 * Float64(F / B))); elseif (F <= 2.65e+137) tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(F / sin(B)))); elseif (F <= 1.4e+185) tmp = t_2; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+21], t$95$2, If[LessEqual[F, 1.1e-132], N[(t$95$1 + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+137], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e+185], t$95$2, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
t_1 := -x \cdot \frac{1}{\tan B}\\
t_2 := t\_1 + \frac{-1}{B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
\;\;\;\;t\_1 + t\_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5e21 or 2.64999999999999984e137 < F < 1.39999999999999991e185Initial program 57.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6445.2
Applied rewrites45.2%
Taylor expanded in F around -inf
lower-/.f6470.3
Applied rewrites70.3%
if -5e21 < F < 1.09999999999999995e-132Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
Applied rewrites84.5%
if 1.09999999999999995e-132 < F < 2.64999999999999984e137Initial program 94.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.1%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites94.0%
Taylor expanded in B around 0
lower-/.f6474.0
Applied rewrites74.0%
if 1.39999999999999991e185 < F Initial program 29.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites25.6%
Taylor expanded in F around inf
Applied rewrites49.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B)))))
(t_1 (+ t_0 (/ -1.0 B)))
(t_2 (fma 2.0 x (fma F F 2.0))))
(if (<= F -4e+20)
t_1
(if (<= F 1.1e-132)
(+ t_0 (* (/ F B) (sqrt (/ 1.0 t_2))))
(if (<= F 2.65e+137)
(+ (- (/ x B)) (* (/ 1.0 (sqrt t_2)) (/ F (sin B))))
(if (<= F 1.4e+185) t_1 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double t_1 = t_0 + (-1.0 / B);
double t_2 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -4e+20) {
tmp = t_1;
} else if (F <= 1.1e-132) {
tmp = t_0 + ((F / B) * sqrt((1.0 / t_2)));
} else if (F <= 2.65e+137) {
tmp = -(x / B) + ((1.0 / sqrt(t_2)) * (F / sin(B)));
} else if (F <= 1.4e+185) {
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)))) t_1 = Float64(t_0 + Float64(-1.0 / B)) t_2 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -4e+20) tmp = t_1; elseif (F <= 1.1e-132) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_2)))); elseif (F <= 2.65e+137) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(1.0 / sqrt(t_2)) * Float64(F / sin(B)))); elseif (F <= 1.4e+185) tmp = t_1; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+20], t$95$1, If[LessEqual[F, 1.1e-132], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+137], N[((-N[(x / B), $MachinePrecision]) + N[(N[(1.0 / N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e+185], 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}\\
t_1 := t\_0 + \frac{-1}{B}\\
t_2 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-132}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_2}}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+137}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sqrt{t\_2}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4e20 or 2.64999999999999984e137 < F < 1.39999999999999991e185Initial program 57.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6445.3
Applied rewrites45.3%
Taylor expanded in F around -inf
lower-/.f6470.3
Applied rewrites70.3%
if -4e20 < F < 1.09999999999999995e-132Initial program 99.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6484.6
Applied rewrites84.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6484.6
Applied rewrites84.6%
if 1.09999999999999995e-132 < F < 2.64999999999999984e137Initial program 94.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.1%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites94.0%
Taylor expanded in B around 0
lower-/.f6474.0
Applied rewrites74.0%
if 1.39999999999999991e185 < F Initial program 29.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites25.6%
Taylor expanded in F around inf
Applied rewrites49.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
(if (<= x -1.1e-35)
t_0
(if (<= x 1000000000.0)
(+
(- (/ x B))
(* (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))) (/ F (sin B))))
t_0))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + (-1.0 / B);
double tmp;
if (x <= -1.1e-35) {
tmp = t_0;
} else if (x <= 1000000000.0) {
tmp = -(x / B) + ((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * (F / sin(B)));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)) tmp = 0.0 if (x <= -1.1e-35) tmp = t_0; elseif (x <= 1000000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * Float64(F / sin(B)))); else tmp = t_0; 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[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.1e-35], t$95$0, If[LessEqual[x, 1000000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1000000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.09999999999999997e-35 or 1e9 < x Initial program 83.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6482.3
Applied rewrites82.3%
Taylor expanded in F around -inf
lower-/.f6494.2
Applied rewrites94.2%
if -1.09999999999999997e-35 < x < 1e9Initial program 72.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites72.2%
Taylor expanded in B around 0
lower-/.f6459.9
Applied rewrites59.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(if (<= B 0.0064)
(/
(-
(fma
F
t_0
(*
(* B B)
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
x)
B)
(+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
double tmp;
if (B <= 0.0064) {
tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))) tmp = 0.0 if (B <= 0.0064) tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 0.0064], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{if}\;B \leq 0.0064:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 0.00640000000000000031Initial program 74.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6438.5
Applied rewrites38.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.3%
if 0.00640000000000000031 < B Initial program 84.9%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6455.8
Applied rewrites55.8%
Taylor expanded in F around -inf
lower-/.f6450.6
Applied rewrites50.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sqrt (+ 2.0 (fma 2.0 x (* F F)))))))
(if (<= F -4e+20)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 4e+86)
(/
(-
(fma
F
t_0
(*
(* B B)
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))))
x)
B)
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sqrt((2.0 + fma(2.0, x, (F * F))));
double tmp;
if (F <= -4e+20) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 4e+86) {
tmp = (fma(F, t_0, ((B * B) * fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sqrt(Float64(2.0 + fma(2.0, x, Float64(F * F))))) tmp = 0.0 if (F <= -4e+20) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 4e+86) tmp = Float64(Float64(fma(F, t_0, Float64(Float64(B * B) * fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+20], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4e+86], N[(N[(N[(F * t$95$0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sqrt{2 + \mathsf{fma}\left(2, x, F \cdot F\right)}}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+86}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, \left(B \cdot B\right) \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right)\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4e20Initial program 57.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites77.9%
if -4e20 < F < 4.0000000000000001e86Initial program 98.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.0%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6433.0
Applied rewrites33.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.8%
if 4.0000000000000001e86 < F Initial program 47.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.0%
Taylor expanded in F around inf
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -4.2e+99)
(/
(-
(*
(* B B)
(-
(fma
(* B B)
(-
(fma
-0.16666666666666666
(* x -0.3333333333333333)
(* 0.008333333333333333 x))
(fma 0.041666666666666664 x 0.019444444444444445))
(* -0.16666666666666666 x))
(fma -0.5 x 0.16666666666666666)))
(+ 1.0 x))
B)
(if (<= F -9e+22)
(/ -1.0 (sin B))
(if (<= F 1.8e+140)
(+
(-
(*
x
(/
(fma
(* B B)
(-
(*
(* B B)
(- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
0.3333333333333333)
1.0)
B)))
(/ (* F 1.0) (* B (sqrt (fma F F (fma 2.0 x 2.0))))))
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e+99) {
tmp = (((B * B) * (fma((B * B), (fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), (-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
} else if (F <= -9e+22) {
tmp = -1.0 / sin(B);
} else if (F <= 1.8e+140) {
tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + ((F * 1.0) / (B * sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.2e+99) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(fma(Float64(B * B), Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), Float64(-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B); elseif (F <= -9e+22) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.8e+140) tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(Float64(F * 1.0) / Float64(B * sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.2e+99], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - N[(0.041666666666666664 * x + 0.019444444444444445), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -9e+22], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+140], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{+99}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq -9 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\
\;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.2000000000000002e99Initial program 46.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.9%
if -4.2000000000000002e99 < F < -8.9999999999999996e22Initial program 92.7%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6460.4
Applied rewrites60.4%
if -8.9999999999999996e22 < F < 1.8e140Initial program 97.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6477.4
Applied rewrites77.4%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6448.0
Applied rewrites48.0%
Taylor expanded in B around 0
lower-*.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6447.9
Applied rewrites47.9%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
+-commutativeN/A
pow2N/A
Applied rewrites50.1%
if 1.8e140 < F Initial program 36.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in F around inf
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(if (<= F -4e+20)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.8e+140)
(+
(-
(*
x
(/
(fma
(* B B)
(-
(*
(* B B)
(- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
0.3333333333333333)
1.0)
B)))
(/ (* F 1.0) (* B (sqrt (fma F F (fma 2.0 x 2.0))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e+20) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.8e+140) {
tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + ((F * 1.0) / (B * sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e+20) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.8e+140) tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(Float64(F * 1.0) / Float64(B * sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e+20], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.8e+140], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+20}:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\
\;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4e20Initial program 57.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites77.9%
if -4e20 < F < 1.8e140Initial program 97.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6477.4
Applied rewrites77.4%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.9
Applied rewrites47.9%
Taylor expanded in B around 0
lower-*.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6447.9
Applied rewrites47.9%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
+-commutativeN/A
pow2N/A
Applied rewrites50.0%
if 1.8e140 < F Initial program 36.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in F around inf
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(if (<= F -4.4e+89)
(/
(-
(*
(* B B)
(-
(fma
(* B B)
(-
(fma
-0.16666666666666666
(* x -0.3333333333333333)
(* 0.008333333333333333 x))
(fma 0.041666666666666664 x 0.019444444444444445))
(* -0.16666666666666666 x))
(fma -0.5 x 0.16666666666666666)))
(+ 1.0 x))
B)
(if (<= F 1.8e+140)
(+
(-
(*
x
(/
(fma
(* B B)
(-
(*
(* B B)
(- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
0.3333333333333333)
1.0)
B)))
(/ (* F 1.0) (* B (sqrt (fma F F (fma 2.0 x 2.0))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.4e+89) {
tmp = (((B * B) * (fma((B * B), (fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), (-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
} else if (F <= 1.8e+140) {
tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + ((F * 1.0) / (B * sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.4e+89) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(fma(Float64(B * B), Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), Float64(-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B); elseif (F <= 1.8e+140) tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(Float64(F * 1.0) / Float64(B * sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.4e+89], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - N[(0.041666666666666664 * x + 0.019444444444444445), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.8e+140], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.4 \cdot 10^{+89}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+140}:\\
\;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.4e89Initial program 47.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
if -4.4e89 < F < 1.8e140Initial program 97.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6476.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.6
Applied rewrites47.6%
Taylor expanded in B around 0
lower-*.f64N/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-+.f64N/A
lift-fma.f64N/A
lift-*.f6447.6
Applied rewrites47.6%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
associate-+r+N/A
pow2N/A
+-commutativeN/A
pow2N/A
Applied rewrites50.1%
if 1.8e140 < F Initial program 36.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in F around inf
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.96e+99)
(/
(-
(*
(* B B)
(-
(fma
(* B B)
(-
(fma
-0.16666666666666666
(* x -0.3333333333333333)
(* 0.008333333333333333 x))
(fma 0.041666666666666664 x 0.019444444444444445))
(* -0.16666666666666666 x))
(fma -0.5 x 0.16666666666666666)))
(+ 1.0 x))
B)
(if (<= F 1.95e-8)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.96e+99) {
tmp = (((B * B) * (fma((B * B), (fma(-0.16666666666666666, (x * -0.3333333333333333), (0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), (-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
} else if (F <= 1.95e-8) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.96e+99) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(fma(Float64(B * B), Float64(fma(-0.16666666666666666, Float64(x * -0.3333333333333333), Float64(0.008333333333333333 * x)) - fma(0.041666666666666664, x, 0.019444444444444445)), Float64(-0.16666666666666666 * x)) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B); elseif (F <= 1.95e-8) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.96e+99], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(x * -0.3333333333333333), $MachinePrecision] + N[(0.008333333333333333 * x), $MachinePrecision]), $MachinePrecision] - N[(0.041666666666666664 * x + 0.019444444444444445), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.96 \cdot 10^{+99}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(-0.16666666666666666, x \cdot -0.3333333333333333, 0.008333333333333333 \cdot x\right) - \mathsf{fma}\left(0.041666666666666664, x, 0.019444444444444445\right), -0.16666666666666666 \cdot x\right) - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.95999999999999992e99Initial program 46.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.9%
if -1.95999999999999992e99 < F < 1.94999999999999992e-8Initial program 98.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6450.7
Applied rewrites50.7%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around inf
+-commutativeN/A
div-addN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.4
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.75e+99)
(+
(-
(*
x
(/
(fma
(* B B)
(-
(*
(* B B)
(- (* -0.0021164021164021165 (* B B)) 0.022222222222222223))
0.3333333333333333)
1.0)
B)))
(/ -1.0 B))
(if (<= F 1.95e-8)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.75e+99) {
tmp = -(x * (fma((B * B), (((B * B) * ((-0.0021164021164021165 * (B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B)) + (-1.0 / B);
} else if (F <= 1.95e-8) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.75e+99) tmp = Float64(Float64(-Float64(x * Float64(fma(Float64(B * B), Float64(Float64(Float64(B * B) * Float64(Float64(-0.0021164021164021165 * Float64(B * B)) - 0.022222222222222223)) - 0.3333333333333333), 1.0) / B))) + Float64(-1.0 / B)); elseif (F <= 1.95e-8) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.75e+99], N[((-N[(x * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.022222222222222223), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.75 \cdot 10^{+99}:\\
\;\;\;\;\left(-x \cdot \frac{\mathsf{fma}\left(B \cdot B, \left(B \cdot B\right) \cdot \left(-0.0021164021164021165 \cdot \left(B \cdot B\right) - 0.022222222222222223\right) - 0.3333333333333333, 1\right)}{B}\right) + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.7499999999999999e99Initial program 46.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6439.2
Applied rewrites39.2%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6415.4
Applied rewrites15.4%
Taylor expanded in F around -inf
lower-/.f6450.7
Applied rewrites50.7%
if -1.7499999999999999e99 < F < 1.94999999999999992e-8Initial program 98.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6450.7
Applied rewrites50.7%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around inf
+-commutativeN/A
div-addN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.4
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.96e+99)
(/
(-
(*
(* B B)
(- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666)))
(+ 1.0 x))
B)
(if (<= F 1.95e-8)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.96e+99) {
tmp = (((B * B) * ((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
} else if (F <= 1.95e-8) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.96e+99) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B); elseif (F <= 1.95e-8) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.96e+99], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.96 \cdot 10^{+99}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.95999999999999992e99Initial program 46.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f6451.1
Applied rewrites51.1%
if -1.95999999999999992e99 < F < 1.94999999999999992e-8Initial program 98.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6450.7
Applied rewrites50.7%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around inf
+-commutativeN/A
div-addN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.4
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -6.8)
(fma 0.5 (/ 2.0 (* B (* F F))) (- (/ (+ 1.0 x) B)))
(if (<= F 1.95e-8)
(/ (- (* (sqrt 0.5) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.8) {
tmp = fma(0.5, (2.0 / (B * (F * F))), -((1.0 + x) / B));
} else if (F <= 1.95e-8) {
tmp = ((sqrt(0.5) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.8) tmp = fma(0.5, Float64(2.0 / Float64(B * Float64(F * F))), Float64(-Float64(Float64(1.0 + x) / B))); elseif (F <= 1.95e-8) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.8], N[(0.5 * N[(2.0 / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{2}{B \cdot \left(F \cdot F\right)}, -\frac{1 + x}{B}\right)\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -6.79999999999999982Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.8%
Taylor expanded in F around -inf
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-+.f6439.7
Applied rewrites39.7%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6450.8
Applied rewrites50.8%
if -6.79999999999999982 < F < 1.94999999999999992e-8Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6450.5
Applied rewrites50.5%
Taylor expanded in x around 0
Applied rewrites50.5%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around inf
+-commutativeN/A
div-addN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.4
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -6.8)
(/
(-
(*
(* B B)
(- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666)))
(+ 1.0 x))
B)
(if (<= F 1.95e-8)
(/ (- (* (sqrt 0.5) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.8) {
tmp = (((B * B) * ((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
} else if (F <= 1.95e-8) {
tmp = ((sqrt(0.5) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.8) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B); elseif (F <= 1.95e-8) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.8], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-8], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -6.79999999999999982Initial program 59.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.3
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f6450.7
Applied rewrites50.7%
if -6.79999999999999982 < F < 1.94999999999999992e-8Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6450.5
Applied rewrites50.5%
Taylor expanded in x around 0
Applied rewrites50.5%
if 1.94999999999999992e-8 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in F around inf
+-commutativeN/A
div-addN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-addN/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.4
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -6.8)
(/
(-
(*
(* B B)
(- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666)))
(+ 1.0 x))
B)
(if (<= F 7500000000000.0) (/ (- (* (sqrt 0.5) F) x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.8) {
tmp = (((B * B) * ((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - (1.0 + x)) / B;
} else if (F <= 7500000000000.0) {
tmp = ((sqrt(0.5) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.8) tmp = Float64(Float64(Float64(Float64(B * B) * Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666))) - Float64(1.0 + x)) / B); elseif (F <= 7500000000000.0) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.8], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7500000000000.0], N[(N[(N[(N[Sqrt[0.5], $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 -6.8:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot \left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 7500000000000:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.79999999999999982Initial program 59.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.3
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f6450.7
Applied rewrites50.7%
if -6.79999999999999982 < F < 7.5e12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.5%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6449.7
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites49.6%
if 7.5e12 < F Initial program 57.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
Applied rewrites50.5%
(FPCore (F B x) :precision binary64 (if (<= F -1.05e-29) (/ (- -1.0 x) B) (if (<= F 7500000000000.0) (/ (- (* (sqrt 0.5) F) x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 7500000000000.0) {
tmp = ((sqrt(0.5) * F) - 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.05d-29)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7500000000000.0d0) then
tmp = ((sqrt(0.5d0) * f) - 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.05e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 7500000000000.0) {
tmp = ((Math.sqrt(0.5) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.05e-29: tmp = (-1.0 - x) / B elif F <= 7500000000000.0: tmp = ((math.sqrt(0.5) * F) - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.05e-29) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7500000000000.0) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - 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.05e-29) tmp = (-1.0 - x) / B; elseif (F <= 7500000000000.0) tmp = ((sqrt(0.5) * F) - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7500000000000.0], N[(N[(N[(N[Sqrt[0.5], $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.05 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7500000000000:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.04999999999999995e-29Initial program 62.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.7%
Taylor expanded in F around -inf
Applied rewrites48.6%
if -1.04999999999999995e-29 < F < 7.5e12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6449.9
Applied rewrites49.9%
Taylor expanded in x around 0
Applied rewrites49.8%
if 7.5e12 < F Initial program 57.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
Applied rewrites50.5%
(FPCore (F B x) :precision binary64 (if (<= F -4.2e-75) (/ (- -1.0 x) B) (if (<= F 4.2e-93) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.2e-93) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.2d-75)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.2d-93) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.2e-93) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.2e-75: tmp = (-1.0 - x) / B elif F <= 4.2e-93: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.2e-75) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.2e-93) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.2e-75) tmp = (-1.0 - x) / B; elseif (F <= 4.2e-93) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e-93], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-75}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-93}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.2000000000000002e-75Initial program 66.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.5%
Taylor expanded in F around -inf
Applied rewrites45.8%
if -4.2000000000000002e-75 < F < 4.2000000000000002e-93Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.6%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6439.2
Applied rewrites39.2%
if 4.2000000000000002e-93 < F Initial program 66.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.7%
Taylor expanded in F around inf
Applied rewrites45.0%
(FPCore (F B x) :precision binary64 (if (<= F -4.2e-75) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e-75) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.2d-75)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e-75) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.2e-75: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.2e-75) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.2e-75) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-75}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -4.2000000000000002e-75Initial program 66.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.5%
Taylor expanded in F around -inf
Applied rewrites45.8%
if -4.2000000000000002e-75 < F Initial program 82.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites45.5%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6432.1
Applied rewrites32.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 77.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.5%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6429.6
Applied rewrites29.6%
herbie shell --seed 2025091
(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))))))