
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 29 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(if (<= F -2e+31)
(/ (fma x (cos B) 1.0) (- (sin B)))
(if (<= F 10000000000.0)
(+ (/ (- x) (tan B)) (/ (* F (sqrt (/ 1.0 (fma F F 2.0)))) (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+31) {
tmp = fma(x, cos(B), 1.0) / -sin(B);
} else if (F <= 10000000000.0) {
tmp = (-x / tan(B)) + ((F * sqrt((1.0 / fma(F, F, 2.0)))) / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+31) tmp = Float64(fma(x, cos(B), 1.0) / Float64(-sin(B))); elseif (F <= 10000000000.0) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F * sqrt(Float64(1.0 / fma(F, F, 2.0)))) / sin(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+31], N[(N[(x * N[Cos[B], $MachinePrecision] + 1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 10000000000.0], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+31}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \cos B, 1\right)}{-\sin B}\\
\mathbf{elif}\;F \leq 10000000000:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.9999999999999999e31Initial program 59.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites75.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
lift-neg.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lower-neg.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -1.9999999999999999e31 < F < 1e10Initial 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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.5
Applied rewrites99.5%
Taylor expanded in x around 0
sqrt-divN/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-/.f6499.5
Applied rewrites99.5%
if 1e10 < F Initial program 66.9%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -5.6e+14)
(/ (fma x (cos B) 1.0) (- (sin B)))
(if (<= F 280000000.0)
(+ (* x (/ -1.0 (tan B))) (* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0)))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e+14) {
tmp = fma(x, cos(B), 1.0) / -sin(B);
} else if (F <= 280000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0))));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.6e+14) tmp = Float64(fma(x, cos(B), 1.0) / Float64(-sin(B))); elseif (F <= 280000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 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, -5.6e+14], N[(N[(x * N[Cos[B], $MachinePrecision] + 1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 280000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $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 -5.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \cos B, 1\right)}{-\sin B}\\
\mathbf{elif}\;F \leq 280000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -5.6e14Initial program 60.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
lift-neg.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lower-neg.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -5.6e14 < F < 2.8e8Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f6499.5
Applied rewrites99.5%
if 2.8e8 < F Initial program 66.9%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(/ (fma x (cos B) 1.0) (- (sin B)))
(if (<= F 1.4)
(+ (/ (- x) (tan B)) (/ (* F (sqrt 0.5)) (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = fma(x, cos(B), 1.0) / -sin(B);
} else if (F <= 1.4) {
tmp = (-x / tan(B)) + ((F * sqrt(0.5)) / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(fma(x, cos(B), 1.0) / Float64(-sin(B))); elseif (F <= 1.4) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F * sqrt(0.5)) / sin(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(x * N[Cos[B], $MachinePrecision] + 1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \cos B, 1\right)}{-\sin B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 63.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6498.7
Applied rewrites98.7%
lift-neg.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lower-neg.f64N/A
lift-sin.f6498.7
Applied rewrites98.7%
if -1.3999999999999999 < F < 1.3999999999999999Initial 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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.5
Applied rewrites99.5%
Taylor expanded in x around 0
sqrt-divN/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-/.f6499.5
Applied rewrites99.5%
Taylor expanded in F around 0
Applied rewrites98.7%
if 1.3999999999999999 < F Initial program 68.7%
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.f6497.3
Applied rewrites97.3%
Final simplification98.3%
(FPCore (F B x)
:precision binary64
(if (<= F -60.0)
(/ (fma x (cos B) 1.0) (- (sin B)))
(if (<= F 10200.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -60.0) {
tmp = fma(x, cos(B), 1.0) / -sin(B);
} else if (F <= 10200.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -60.0) tmp = Float64(fma(x, cos(B), 1.0) / Float64(-sin(B))); elseif (F <= 10200.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + 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, -60.0], N[(N[(x * N[Cos[B], $MachinePrecision] + 1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 10200.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $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 -60:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \cos B, 1\right)}{-\sin B}\\
\mathbf{elif}\;F \leq 10200:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -60Initial program 63.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6498.7
Applied rewrites98.7%
lift-neg.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lower-neg.f64N/A
lift-sin.f6498.7
Applied rewrites98.7%
if -60 < F < 10200Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6481.6
Applied rewrites81.6%
if 10200 < F Initial program 67.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Final simplification90.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2.75e+14)
(/ (- -1.0 x) (sin B))
(if (<= F 10200.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.75e+14) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 10200.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.75e+14) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 10200.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + 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, -2.75e+14], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 10200.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $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 -2.75 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 10200:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.75e14Initial program 60.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites72.7%
if -2.75e14 < F < 10200Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6481.4
Applied rewrites81.4%
if 10200 < F Initial program 67.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Final simplification84.7%
(FPCore (F B x)
:precision binary64
(if (<= x -1.9e-51)
(* (/ (cos B) (- (sin B))) x)
(if (<= x 3.2e-32)
(+ (- (/ x B)) (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
(- (/ (* (cos B) x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.9e-51) {
tmp = (cos(B) / -sin(B)) * x;
} else if (x <= 3.2e-32) {
tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else {
tmp = -((cos(B) * x) / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.9e-51) tmp = Float64(Float64(cos(B) / Float64(-sin(B))) * x); elseif (x <= 3.2e-32) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); else tmp = Float64(-Float64(Float64(cos(B) * x) / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.9e-51], N[(N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 3.2e-32], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-51}:\\
\;\;\;\;\frac{\cos B}{-\sin B} \cdot x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-32}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if x < -1.90000000000000001e-51Initial program 90.7%
Taylor expanded in x around inf
Applied rewrites33.9%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-/.f6493.1
Applied rewrites93.1%
if -1.90000000000000001e-51 < x < 3.2000000000000002e-32Initial program 79.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites81.0%
Taylor expanded in B around 0
lower-/.f6467.0
Applied rewrites67.0%
if 3.2000000000000002e-32 < x Initial program 83.7%
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.f6491.0
Applied rewrites91.0%
Final simplification78.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* (cos B) x) (sin B)))))
(if (<= x -3.2e-53)
t_0
(if (<= x 3.2e-32)
(+ (- (/ x B)) (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = -((cos(B) * x) / sin(B));
double tmp;
if (x <= -3.2e-53) {
tmp = t_0;
} else if (x <= 3.2e-32) {
tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(cos(B) * x) / sin(B))) tmp = 0.0 if (x <= -3.2e-53) tmp = t_0; elseif (x <= 3.2e-32) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -3.2e-53], t$95$0, If[LessEqual[x, 3.2e-32], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{\cos B \cdot x}{\sin B}\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{-53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-32}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.2000000000000001e-53 or 3.2000000000000002e-32 < x Initial program 86.2%
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.f6491.8
Applied rewrites91.8%
if -3.2000000000000001e-53 < x < 3.2000000000000002e-32Initial program 79.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites81.0%
Taylor expanded in B around 0
lower-/.f6467.0
Applied rewrites67.0%
Final simplification78.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2.75e+14)
(/ (- -1.0 x) (sin B))
(if (<= F 1.02e-241)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
(if (<= F 2.05e+133)
(+ (- (/ x B)) (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
(+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.75e+14) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.02e-241) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
} else if (F <= 2.05e+133) {
tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else {
tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.75e+14) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.02e-241) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0))))); elseif (F <= 2.05e+133) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); else tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.75e+14], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-241], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.05e+133], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.75 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-241}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{+133}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -2.75e14Initial program 60.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites72.7%
if -2.75e14 < F < 1.01999999999999994e-241Initial program 99.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6487.4
Applied rewrites87.4%
if 1.01999999999999994e-241 < F < 2.05000000000000002e133Initial program 97.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6483.1
Applied rewrites83.1%
if 2.05000000000000002e133 < F Initial program 47.6%
Taylor expanded in F around inf
lower-/.f6488.0
Applied rewrites88.0%
Taylor expanded in B around 0
Applied rewrites60.3%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-tan.f6460.4
Applied rewrites60.4%
Final simplification78.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2.75e+14)
(/ (- -1.0 x) (sin B))
(if (<= F 11200.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
(if (<= F 3.4e+210)
(+
(* x (/ -1.0 (* B (- 1.0 (* -0.3333333333333333 (* B B))))))
(* (/ F (sin B)) (/ 1.0 F)))
(+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.75e+14) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 11200.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
} else if (F <= 3.4e+210) {
tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / sin(B)) * (1.0 / F));
} else {
tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.75e+14) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 11200.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0))))); elseif (F <= 3.4e+210) tmp = Float64(Float64(x * Float64(-1.0 / Float64(B * Float64(1.0 - Float64(-0.3333333333333333 * Float64(B * B)))))) + Float64(Float64(F / sin(B)) * Float64(1.0 / F))); else tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.75e+14], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 11200.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+210], N[(N[(x * N[(-1.0 / N[(B * N[(1.0 - N[(-0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.75 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 11200:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\
\;\;\;\;x \cdot \frac{-1}{B \cdot \left(1 - -0.3333333333333333 \cdot \left(B \cdot B\right)\right)} + \frac{F}{\sin B} \cdot \frac{1}{F}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -2.75e14Initial program 60.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites72.7%
if -2.75e14 < F < 11200Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6481.4
Applied rewrites81.4%
if 11200 < F < 3.40000000000000025e210Initial program 77.7%
Taylor expanded in F around inf
lower-/.f6492.9
Applied rewrites92.9%
Taylor expanded in B around 0
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6479.0
Applied rewrites79.0%
if 3.40000000000000025e210 < F Initial program 48.8%
Taylor expanded in F around inf
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in B around 0
Applied rewrites61.2%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-tan.f6461.3
Applied rewrites61.3%
Final simplification77.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -2.75e+14)
(/ (- -1.0 x) (sin B))
(if (<= F 11200.0)
(+ t_0 (* (/ F B) (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))))
(if (<= F 3.4e+210)
(+
(* x (/ -1.0 (* B (- 1.0 (* -0.3333333333333333 (* B B))))))
(* (/ F (sin B)) (/ 1.0 F)))
(+ t_0 (* (/ F B) (/ 1.0 F))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -2.75e+14) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 11200.0) {
tmp = t_0 + ((F / B) * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))));
} else if (F <= 3.4e+210) {
tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / sin(B)) * (1.0 / F));
} else {
tmp = t_0 + ((F / B) * (1.0 / F));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2.75e+14) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 11200.0) tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))))); elseif (F <= 3.4e+210) tmp = Float64(Float64(x * Float64(-1.0 / Float64(B * Float64(1.0 - Float64(-0.3333333333333333 * Float64(B * B)))))) + Float64(Float64(F / sin(B)) * Float64(1.0 / F))); else tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.75e+14], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 11200.0], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+210], N[(N[(x * N[(-1.0 / N[(B * N[(1.0 - N[(-0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2.75 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 11200:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\
\;\;\;\;x \cdot \frac{-1}{B \cdot \left(1 - -0.3333333333333333 \cdot \left(B \cdot B\right)\right)} + \frac{F}{\sin B} \cdot \frac{1}{F}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -2.75e14Initial program 60.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites72.7%
if -2.75e14 < F < 11200Initial 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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f6481.4
Applied rewrites81.4%
if 11200 < F < 3.40000000000000025e210Initial program 77.7%
Taylor expanded in F around inf
lower-/.f6492.9
Applied rewrites92.9%
Taylor expanded in B around 0
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6479.0
Applied rewrites79.0%
if 3.40000000000000025e210 < F Initial program 48.8%
Taylor expanded in F around inf
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in B around 0
Applied rewrites61.2%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-tan.f6461.3
Applied rewrites61.3%
Final simplification77.2%
(FPCore (F B x)
:precision binary64
(if (<= F -70000.0)
(/ (- -1.0 x) (sin B))
(if (<= F 0.72)
(+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (+ x x))))))
(if (<= F 3.4e+210)
(+
(* x (/ -1.0 (* B (- 1.0 (* -0.3333333333333333 (* B B))))))
(* (/ F (sin B)) (/ 1.0 F)))
(+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -70000.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 0.72) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x)))));
} else if (F <= 3.4e+210) {
tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / sin(B)) * (1.0 / F));
} else {
tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
}
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 <= (-70000.0d0)) then
tmp = ((-1.0d0) - x) / sin(b)
else if (f <= 0.72d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * sqrt((1.0d0 / (2.0d0 + (x + x)))))
else if (f <= 3.4d+210) then
tmp = (x * ((-1.0d0) / (b * (1.0d0 - ((-0.3333333333333333d0) * (b * b)))))) + ((f / sin(b)) * (1.0d0 / f))
else
tmp = (-x / tan(b)) + ((f / b) * (1.0d0 / f))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -70000.0) {
tmp = (-1.0 - x) / Math.sin(B);
} else if (F <= 0.72) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * Math.sqrt((1.0 / (2.0 + (x + x)))));
} else if (F <= 3.4e+210) {
tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / Math.sin(B)) * (1.0 / F));
} else {
tmp = (-x / Math.tan(B)) + ((F / B) * (1.0 / F));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -70000.0: tmp = (-1.0 - x) / math.sin(B) elif F <= 0.72: tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * math.sqrt((1.0 / (2.0 + (x + x))))) elif F <= 3.4e+210: tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / math.sin(B)) * (1.0 / F)) else: tmp = (-x / math.tan(B)) + ((F / B) * (1.0 / F)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -70000.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 0.72) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x + x)))))); elseif (F <= 3.4e+210) tmp = Float64(Float64(x * Float64(-1.0 / Float64(B * Float64(1.0 - Float64(-0.3333333333333333 * Float64(B * B)))))) + Float64(Float64(F / sin(B)) * Float64(1.0 / F))); else tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -70000.0) tmp = (-1.0 - x) / sin(B); elseif (F <= 0.72) tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x))))); elseif (F <= 3.4e+210) tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / sin(B)) * (1.0 / F)); else tmp = (-x / tan(B)) + ((F / B) * (1.0 / F)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.72], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+210], N[(N[(x * N[(-1.0 / N[(B * N[(1.0 - N[(-0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -70000:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 0.72:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\
\;\;\;\;x \cdot \frac{-1}{B \cdot \left(1 - -0.3333333333333333 \cdot \left(B \cdot B\right)\right)} + \frac{F}{\sin B} \cdot \frac{1}{F}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -7e4Initial program 61.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites73.2%
if -7e4 < F < 0.71999999999999997Initial program 99.5%
Taylor expanded in F around inf
lower-/.f6432.6
Applied rewrites32.6%
Taylor expanded in B around 0
Applied rewrites50.7%
Taylor expanded in F around 0
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
count-2-revN/A
lower-+.f6481.0
Applied rewrites81.0%
if 0.71999999999999997 < F < 3.40000000000000025e210Initial program 78.6%
Taylor expanded in F around inf
lower-/.f6490.4
Applied rewrites90.4%
Taylor expanded in B around 0
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6477.0
Applied rewrites77.0%
if 3.40000000000000025e210 < F Initial program 48.8%
Taylor expanded in F around inf
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in B around 0
Applied rewrites61.2%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-tan.f6461.3
Applied rewrites61.3%
Final simplification76.7%
(FPCore (F B x)
:precision binary64
(if (<= F -70000.0)
(/ (- -1.0 x) (sin B))
(if (<= F 0.72)
(+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (+ x x))))))
(if (<= F 3.4e+210)
(+ (- (/ x B)) (* (/ F (sin B)) (/ 1.0 F)))
(+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -70000.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 0.72) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x)))));
} else if (F <= 3.4e+210) {
tmp = -(x / B) + ((F / sin(B)) * (1.0 / F));
} else {
tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
}
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 <= (-70000.0d0)) then
tmp = ((-1.0d0) - x) / sin(b)
else if (f <= 0.72d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * sqrt((1.0d0 / (2.0d0 + (x + x)))))
else if (f <= 3.4d+210) then
tmp = -(x / b) + ((f / sin(b)) * (1.0d0 / f))
else
tmp = (-x / tan(b)) + ((f / b) * (1.0d0 / f))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -70000.0) {
tmp = (-1.0 - x) / Math.sin(B);
} else if (F <= 0.72) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * Math.sqrt((1.0 / (2.0 + (x + x)))));
} else if (F <= 3.4e+210) {
tmp = -(x / B) + ((F / Math.sin(B)) * (1.0 / F));
} else {
tmp = (-x / Math.tan(B)) + ((F / B) * (1.0 / F));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -70000.0: tmp = (-1.0 - x) / math.sin(B) elif F <= 0.72: tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * math.sqrt((1.0 / (2.0 + (x + x))))) elif F <= 3.4e+210: tmp = -(x / B) + ((F / math.sin(B)) * (1.0 / F)) else: tmp = (-x / math.tan(B)) + ((F / B) * (1.0 / F)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -70000.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 0.72) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x + x)))))); elseif (F <= 3.4e+210) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(1.0 / F))); else tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -70000.0) tmp = (-1.0 - x) / sin(B); elseif (F <= 0.72) tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x))))); elseif (F <= 3.4e+210) tmp = -(x / B) + ((F / sin(B)) * (1.0 / F)); else tmp = (-x / tan(B)) + ((F / B) * (1.0 / F)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.72], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+210], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -70000:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 0.72:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -7e4Initial program 61.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.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
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites73.2%
if -7e4 < F < 0.71999999999999997Initial program 99.5%
Taylor expanded in F around inf
lower-/.f6432.6
Applied rewrites32.6%
Taylor expanded in B around 0
Applied rewrites50.7%
Taylor expanded in F around 0
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
count-2-revN/A
lower-+.f6481.0
Applied rewrites81.0%
if 0.71999999999999997 < F < 3.40000000000000025e210Initial program 78.6%
Taylor expanded in F around inf
lower-/.f6490.4
Applied rewrites90.4%
Taylor expanded in B around 0
lower-/.f6477.0
Applied rewrites77.0%
if 3.40000000000000025e210 < F Initial program 48.8%
Taylor expanded in F around inf
lower-/.f6484.4
Applied rewrites84.4%
Taylor expanded in B around 0
Applied rewrites61.2%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-tan.f6461.3
Applied rewrites61.3%
Final simplification76.7%
(FPCore (F B x)
:precision binary64
(if (<= B 3.5e-5)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(if (<= B 1e+15)
(/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) (sin B))
(+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.5e-5) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else if (B <= 1e+15) {
tmp = (sqrt((1.0 / fma(F, F, 2.0))) * F) / sin(B);
} else {
tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.5e-5) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); elseif (B <= 1e+15) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / sin(B)); else tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.5e-5], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 1e+15], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{elif}\;B \leq 10^{+15}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if B < 3.4999999999999997e-5Initial program 81.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.9%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
if 3.4999999999999997e-5 < B < 1e15Initial program 67.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6450.2
Applied rewrites50.2%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites50.0%
if 1e15 < B Initial program 88.7%
Taylor expanded in F around inf
lower-/.f6456.1
Applied rewrites56.1%
Taylor expanded in B around 0
Applied rewrites53.9%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-tan.f6454.0
Applied rewrites54.0%
Final simplification53.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
(if (<= B 0.64)
(/
(-
(fma
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B)
(* t_0 F))
x)
B)
(+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (fma(F, F, (x + x)) + 2.0)));
double tmp;
if (B <= 0.64) {
tmp = (fma(fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)), (B * B), (t_0 * F)) - x) / B;
} else {
tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0))) tmp = 0.0 if (B <= 0.64) tmp = Float64(Float64(fma(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)), Float64(B * B), Float64(t_0 * F)) - x) / B); else tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.64], N[(N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
\mathbf{if}\;B \leq 0.64:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right), B \cdot B, t\_0 \cdot F\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if B < 0.640000000000000013Initial program 81.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites54.0%
if 0.640000000000000013 < B Initial program 86.6%
Taylor expanded in F around inf
lower-/.f6455.0
Applied rewrites55.0%
Taylor expanded in B around 0
Applied rewrites50.4%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-tan.f6450.6
Applied rewrites50.6%
Final simplification53.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sin B))))
(if (<= F -520.0)
(/ (- -1.0 x) (sin B))
(if (<= F -2e-87)
(/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) (sin B))
(if (<= F 8.5e-142)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(if (<= F 10000000.0)
(* (/ 1.0 (sqrt (fma F F 2.0))) t_0)
(+ (- (/ x B)) (* t_0 (/ 1.0 F)))))))))
double code(double F, double B, double x) {
double t_0 = F / sin(B);
double tmp;
if (F <= -520.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= -2e-87) {
tmp = (sqrt((1.0 / fma(F, F, 2.0))) * F) / sin(B);
} else if (F <= 8.5e-142) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else if (F <= 10000000.0) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * t_0;
} else {
tmp = -(x / B) + (t_0 * (1.0 / F));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sin(B)) tmp = 0.0 if (F <= -520.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= -2e-87) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / sin(B)); elseif (F <= 8.5e-142) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); elseif (F <= 10000000.0) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * t_0); else tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -520.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2e-87], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.5e-142], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 10000000.0], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -520:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq -2 \cdot 10^{-87}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{\sin B}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{-142}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 10000000:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -520Initial program 63.0%
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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites72.4%
if -520 < F < -2.00000000000000004e-87Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6459.0
Applied rewrites59.0%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites59.3%
if -2.00000000000000004e-87 < F < 8.4999999999999996e-142Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.4%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6453.5
Applied rewrites53.5%
if 8.4999999999999996e-142 < F < 1e7Initial program 99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6457.3
Applied rewrites57.3%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6457.4
Applied rewrites57.4%
if 1e7 < F Initial program 67.4%
Taylor expanded in F around inf
lower-/.f6490.3
Applied rewrites90.3%
Taylor expanded in B around 0
lower-/.f6464.1
Applied rewrites64.1%
Final simplification61.5%
(FPCore (F B x)
:precision binary64
(if (<= F -0.56)
(/ (- -1.0 x) (sin B))
(if (<= F -2e-87)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 1.2e+44)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.56) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= -2e-87) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 1.2e+44) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.56) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= -2e-87) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 1.2e+44) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.56], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2e-87], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e+44], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.56:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq -2 \cdot 10^{-87}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.56000000000000005Initial program 63.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6498.7
Applied rewrites98.7%
Taylor expanded in B around 0
Applied rewrites71.7%
if -0.56000000000000005 < F < -2.00000000000000004e-87Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6456.8
Applied rewrites56.8%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
sqrt-unprodN/A
lower-/.f64N/A
sqrt-unprodN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f64N/A
lower-sqrt.f64N/A
metadata-evalN/A
lift-sin.f6455.6
Applied rewrites55.6%
if -2.00000000000000004e-87 < F < 1.20000000000000007e44Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.2%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6452.2
Applied rewrites52.2%
if 1.20000000000000007e44 < F Initial program 65.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6428.1
Applied rewrites28.1%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6454.2
Applied rewrites54.2%
Final simplification57.2%
(FPCore (F B x) :precision binary64 (if (<= B 3.5e-5) (/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B) (/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.5e-5) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = (sqrt((1.0 / fma(F, F, 2.0))) * F) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.5e-5) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.5e-5], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{\sin B}\\
\end{array}
\end{array}
if B < 3.4999999999999997e-5Initial program 81.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.9%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
if 3.4999999999999997e-5 < B Initial program 86.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites34.7%
Final simplification48.6%
(FPCore (F B x) :precision binary64 (if (<= B 3.5e-5) (/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B) (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.5e-5) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.5e-5) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.5e-5], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\end{array}
\end{array}
if B < 3.4999999999999997e-5Initial program 81.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.9%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
if 3.4999999999999997e-5 < B Initial program 86.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6434.6
Applied rewrites34.6%
Final simplification48.6%
(FPCore (F B x)
:precision binary64
(if (<= F -60.0)
(/ (- -1.0 x) (sin B))
(if (<= F 1.2e+44)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -60.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.2e+44) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -60.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.2e+44) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -60.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e+44], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -60:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -60Initial program 63.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6498.7
Applied rewrites98.7%
Taylor expanded in B around 0
Applied rewrites71.7%
if -60 < F < 1.20000000000000007e44Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.3%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6449.3
Applied rewrites49.3%
if 1.20000000000000007e44 < F Initial program 65.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6428.1
Applied rewrites28.1%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6454.2
Applied rewrites54.2%
Final simplification55.5%
(FPCore (F B x)
:precision binary64
(if (<= F -9e+170)
(/ (- -1.0 x) B)
(if (<= F -2.75e+14)
(/ -1.0 (sin B))
(if (<= F 1.2e+44)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e+170) {
tmp = (-1.0 - x) / B;
} else if (F <= -2.75e+14) {
tmp = -1.0 / sin(B);
} else if (F <= 1.2e+44) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e+170) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -2.75e+14) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.2e+44) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e+170], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -2.75e+14], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e+44], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{+170}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -2.75 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -9.00000000000000044e170Initial program 37.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.8%
Taylor expanded in F around -inf
Applied rewrites55.4%
if -9.00000000000000044e170 < F < -2.75e14Initial program 84.7%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites88.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6471.7
Applied rewrites71.7%
if -2.75e14 < F < 1.20000000000000007e44Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.4%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6449.4
Applied rewrites49.4%
if 1.20000000000000007e44 < F Initial program 65.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6428.1
Applied rewrites28.1%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6454.2
Applied rewrites54.2%
Final simplification53.5%
(FPCore (F B x) :precision binary64 (if (<= B 3.5e-5) (/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B) (/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.5e-5) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.5e-5) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.5e-5], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 3.4999999999999997e-5Initial program 81.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.9%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
if 3.4999999999999997e-5 < B Initial program 86.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6434.6
Applied rewrites34.6%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6419.7
Applied rewrites19.7%
Final simplification44.5%
(FPCore (F B x)
:precision binary64
(if (<= F -78.0)
(/ (- -1.0 x) B)
(if (<= F 4e+53)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -78.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 4e+53) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -78.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4e+53) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -78.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e+53], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -78:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+53}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -78Initial program 63.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.8%
Taylor expanded in F around -inf
Applied rewrites45.1%
if -78 < F < 4e53Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.0%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6449.0
Applied rewrites49.0%
if 4e53 < F Initial program 64.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites29.7%
Taylor expanded in F around inf
Applied rewrites40.2%
Final simplification45.9%
(FPCore (F B x)
:precision binary64
(if (<= F -70000.0)
(/ (- -1.0 x) B)
(if (<= F 1.75)
(/ (- (* F (sqrt (/ 1.0 (fma 2.0 x 2.0)))) 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 <= -70000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.75) {
tmp = ((F * sqrt((1.0 / fma(2.0, x, 2.0)))) - 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 <= -70000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.75) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / fma(2.0, x, 2.0)))) - 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, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.75], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -70000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.75:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - 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 < -7e4Initial program 61.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.7%
Taylor expanded in F around -inf
Applied rewrites45.7%
if -7e4 < F < 1.75Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites47.6%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-+.f64N/A
count-2-revN/A
lift-+.f64N/A
pow2N/A
lower-*.f643.2
Applied rewrites3.2%
Taylor expanded in F around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6446.9
Applied rewrites46.9%
if 1.75 < F Initial program 68.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.9%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-+.f64N/A
count-2-revN/A
lift-+.f64N/A
pow2N/A
lower-*.f6421.1
Applied rewrites21.1%
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-*.f6442.4
Applied rewrites42.4%
Final simplification45.3%
(FPCore (F B x)
:precision binary64
(if (<= F -70000.0)
(/ (- -1.0 x) B)
(if (<= F 1.7)
(/ (- (* F (sqrt (/ 1.0 (fma 2.0 x 2.0)))) x) B)
(/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -70000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.7) {
tmp = ((F * sqrt((1.0 / fma(2.0, x, 2.0)))) - x) / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -70000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.7) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / fma(2.0, x, 2.0)))) - x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -70000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.7:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\end{array}
\end{array}
if F < -7e4Initial program 61.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.7%
Taylor expanded in F around -inf
Applied rewrites45.7%
if -7e4 < F < 1.69999999999999996Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites47.6%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-+.f64N/A
count-2-revN/A
lift-+.f64N/A
pow2N/A
lower-*.f643.2
Applied rewrites3.2%
Taylor expanded in F around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6446.9
Applied rewrites46.9%
if 1.69999999999999996 < F Initial program 68.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.9%
Taylor expanded in F around inf
lift-/.f6442.2
Applied rewrites42.2%
Final simplification45.2%
(FPCore (F B x)
:precision binary64
(if (<= F -70000.0)
(/ (- -1.0 x) B)
(if (<= F 1.35)
(fma (/ F B) (sqrt 0.5) (/ (- x) B))
(/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -70000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.35) {
tmp = fma((F / B), sqrt(0.5), (-x / B));
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -70000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.35) tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-x) / B)); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.35], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -70000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.35:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\end{array}
\end{array}
if F < -7e4Initial program 61.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.7%
Taylor expanded in F around -inf
Applied rewrites45.7%
if -7e4 < F < 1.3500000000000001Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites47.6%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6431.6
Applied rewrites31.6%
Taylor expanded in F around 0
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6446.8
Applied rewrites46.8%
Taylor expanded in x around 0
Applied rewrites46.8%
if 1.3500000000000001 < F Initial program 68.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.9%
Taylor expanded in F around inf
lift-/.f6442.2
Applied rewrites42.2%
Final simplification45.2%
(FPCore (F B x) :precision binary64 (if (<= F -2.8e-75) (/ (- -1.0 x) B) (if (<= F 3.6e-47) (/ (- x) B) (/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e-47) {
tmp = -x / B;
} else {
tmp = (((1.0 / F) * F) - 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 <= (-2.8d-75)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.6d-47) then
tmp = -x / b
else
tmp = (((1.0d0 / f) * f) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e-47) {
tmp = -x / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.8e-75: tmp = (-1.0 - x) / B elif F <= 3.6e-47: tmp = -x / B else: tmp = (((1.0 / F) * F) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.8e-75) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.6e-47) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.8e-75) tmp = (-1.0 - x) / B; elseif (F <= 3.6e-47) tmp = -x / B; else tmp = (((1.0 / F) * F) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.8e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e-47], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\end{array}
\end{array}
if F < -2.79999999999999998e-75Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites36.8%
if -2.79999999999999998e-75 < F < 3.59999999999999991e-47Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6437.5
Applied rewrites37.5%
if 3.59999999999999991e-47 < F Initial program 71.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites35.9%
Taylor expanded in F around inf
lift-/.f6439.2
Applied rewrites39.2%
Final simplification37.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.8e-75) (/ (- -1.0 x) B) (if (<= F 3.6e-47) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e-47) {
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 <= (-2.8d-75)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.6d-47) 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 <= -2.8e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e-47) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.8e-75: tmp = (-1.0 - x) / B elif F <= 3.6e-47: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.8e-75) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.6e-47) 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 <= -2.8e-75) tmp = (-1.0 - x) / B; elseif (F <= 3.6e-47) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.8e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e-47], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.79999999999999998e-75Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites36.8%
if -2.79999999999999998e-75 < F < 3.59999999999999991e-47Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6437.5
Applied rewrites37.5%
if 3.59999999999999991e-47 < F Initial program 71.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites35.9%
Taylor expanded in F around inf
Applied rewrites39.2%
Final simplification37.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.8e-75) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-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 <= (-2.8d-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 <= -2.8e-75) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.8e-75: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.8e-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 <= -2.8e-75) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.8e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.79999999999999998e-75Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites36.8%
if -2.79999999999999998e-75 < F Initial program 86.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.8%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6429.6
Applied rewrites29.6%
Final simplification31.7%
(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 82.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.5%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6426.1
Applied rewrites26.1%
Final simplification26.1%
herbie shell --seed 2025064
(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))))))