
(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 30 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 -8e+90)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 1e+152)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e+90) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 1e+152) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8e+90) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 1e+152) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8e+90], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+152], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{+90}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -7.99999999999999973e90Initial program 50.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -7.99999999999999973e90 < F < 1e152Initial program 97.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.9%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites98.9%
Applied rewrites99.6%
if 1e152 < F Initial program 31.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -4e+89)
(+ (/ (- x) (tan B)) (/ -1.0 (sin B)))
(if (<= F 470000000.0)
(+
(* x (/ -1.0 (tan B)))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (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 <= -4e+89) {
tmp = (-x / tan(B)) + (-1.0 / sin(B));
} else if (F <= 470000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F * (1.0 / sqrt(fma(2.0, x, 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 <= -4e+89) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(-1.0 / sin(B))); elseif (F <= 470000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, 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, -4e+89], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 470000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $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 -4 \cdot 10^{+89}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 470000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -3.99999999999999998e89Initial program 51.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6464.2
Applied rewrites64.2%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -3.99999999999999998e89 < F < 4.7e8Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
if 4.7e8 < F Initial program 54.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.f6499.6
Applied rewrites99.6%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+89)
(+ (/ (- x) (tan B)) (/ -1.0 (sin B)))
(if (<= F 400000000.0)
(+
(* x (/ -1.0 (tan B)))
(/ (/ F (sqrt (fma 2.0 x (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 <= -5e+89) {
tmp = (-x / tan(B)) + (-1.0 / sin(B));
} else if (F <= 400000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sqrt(fma(2.0, x, 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 <= -5e+89) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(-1.0 / sin(B))); elseif (F <= 400000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sqrt(fma(2.0, x, 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, -5e+89], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 400000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sqrt[N[(2.0 * x + 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 -5 \cdot 10^{+89}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 400000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -4.99999999999999983e89Initial program 51.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6464.2
Applied rewrites64.2%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -4.99999999999999983e89 < F < 4e8Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.5
Applied rewrites99.5%
if 4e8 < F Initial program 54.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.f6499.6
Applied rewrites99.6%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35)
(+ (/ (- x) (tan B)) (/ -1.0 (sin B)))
(if (<= F 1.6)
(+
(* x (/ -1.0 (tan B)))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x 2.0)))) (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35) {
tmp = (-x / tan(B)) + (-1.0 / sin(B));
} else if (F <= 1.6) {
tmp = (x * (-1.0 / tan(B))) + ((F * (1.0 / sqrt(fma(2.0, x, 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 <= -1.35) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(-1.0 / sin(B))); elseif (F <= 1.6) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, 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, -1.35], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + 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 -1.35:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.6:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3500000000000001Initial program 61.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites71.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6471.2
Applied rewrites71.2%
Taylor expanded in F around -inf
Applied rewrites99.4%
if -1.3500000000000001 < F < 1.6000000000000001Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in F around 0
Applied rewrites99.0%
if 1.6000000000000001 < F Initial program 55.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.1
Applied rewrites99.1%
Final simplification99.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))) (t_1 (fma 2.0 x (fma F F 2.0))))
(if (<= F -1.05e-7)
(+ (/ (- x) (tan B)) (/ -1.0 (sin B)))
(if (<= F -1.3e-207)
(+ t_0 (/ (* F (/ 1.0 (sqrt t_1))) (sin B)))
(if (<= F 1.65e-174)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 2e+24)
(+ t_0 (/ (* F (pow t_1 -0.5)) (sin B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double t_1 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -1.05e-7) {
tmp = (-x / tan(B)) + (-1.0 / sin(B));
} else if (F <= -1.3e-207) {
tmp = t_0 + ((F * (1.0 / sqrt(t_1))) / sin(B));
} else if (F <= 1.65e-174) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 2e+24) {
tmp = t_0 + ((F * pow(t_1, -0.5)) / sin(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) t_1 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(-1.0 / sin(B))); elseif (F <= -1.3e-207) tmp = Float64(t_0 + Float64(Float64(F * Float64(1.0 / sqrt(t_1))) / sin(B))); elseif (F <= 1.65e-174) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 2e+24) tmp = Float64(t_0 + Float64(Float64(F * (t_1 ^ -0.5)) / sin(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$1 = N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05e-7], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-207], N[(t$95$0 + N[(N[(F * N[(1.0 / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e-174], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+24], N[(t$95$0 + N[(N[(F * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
t_1 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-207}:\\
\;\;\;\;t\_0 + \frac{F \cdot \frac{1}{\sqrt{t\_1}}}{\sin B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-174}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+24}:\\
\;\;\;\;t\_0 + \frac{F \cdot {t\_1}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites71.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6471.7
Applied rewrites71.7%
Taylor expanded in F around -inf
Applied rewrites99.5%
if -1.05e-7 < F < -1.3e-207Initial program 99.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.2%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6478.0
Applied rewrites78.0%
if -1.3e-207 < F < 1.65e-174Initial program 99.5%
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.f6486.5
Applied rewrites86.5%
if 1.65e-174 < F < 2e24Initial program 96.7%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites96.7%
Taylor expanded in B around 0
lower-/.f6479.2
Applied rewrites79.2%
if 2e24 < F Initial program 54.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites65.8%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification90.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (fma 2.0 x (fma F F 2.0))))
(if (<= F -1.05e-7)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F -3.6e-150)
(+ (- (/ x B)) (/ (* F (/ 1.0 (sqrt t_1))) (sin B)))
(if (<= F 3.6e-6)
(+ t_0 (/ (* F (pow t_1 -0.5)) B))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -1.05e-7) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= -3.6e-150) {
tmp = -(x / B) + ((F * (1.0 / sqrt(t_1))) / sin(B));
} else if (F <= 3.6e-6) {
tmp = t_0 + ((F * pow(t_1, -0.5)) / B);
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= -3.6e-150) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(t_1))) / sin(B))); elseif (F <= 3.6e-6) tmp = Float64(t_0 + Float64(Float64(F * (t_1 ^ -0.5)) / B)); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05e-7], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.6e-150], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e-6], N[(t$95$0 + N[(N[(F * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -3.6 \cdot 10^{-150}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{t\_1}}}{\sin B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-6}:\\
\;\;\;\;t\_0 + \frac{F \cdot {t\_1}^{-0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites71.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6471.7
Applied rewrites71.7%
Taylor expanded in F around -inf
Applied rewrites99.5%
if -1.05e-7 < F < -3.6000000000000002e-150Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
lower-/.f6484.4
Applied rewrites84.4%
if -3.6000000000000002e-150 < F < 3.59999999999999984e-6Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
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
Applied rewrites86.7%
if 3.59999999999999984e-6 < F Initial program 56.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.9
Applied rewrites97.9%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ x B))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))))
(if (<= F -1.05e-7)
(+ (/ (- x) (tan B)) (/ -1.0 (sin B)))
(if (<= F -1.3e-207)
t_0
(if (<= F 1.65e-174)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 2e+24) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
double tmp;
if (F <= -1.05e-7) {
tmp = (-x / tan(B)) + (-1.0 / sin(B));
} else if (F <= -1.3e-207) {
tmp = t_0;
} else if (F <= 1.65e-174) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 2e+24) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(-1.0 / sin(B))); elseif (F <= -1.3e-207) tmp = t_0; elseif (F <= 1.65e-174) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 2e+24) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05e-7], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-207], t$95$0, If[LessEqual[F, 1.65e-174], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+24], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-207}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-174}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites71.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6471.7
Applied rewrites71.7%
Taylor expanded in F around -inf
Applied rewrites99.5%
if -1.05e-7 < F < -1.3e-207 or 1.65e-174 < F < 2e24Initial program 98.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.1%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites98.1%
Taylor expanded in B around 0
lower-/.f6478.5
Applied rewrites78.5%
if -1.3e-207 < F < 1.65e-174Initial program 99.5%
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.f6486.5
Applied rewrites86.5%
if 2e24 < F Initial program 54.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites65.8%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification90.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ x B))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B))))
(t_1 (* x (/ -1.0 (tan B)))))
(if (<= F -1.05e-7)
(+ t_1 (/ -1.0 (sin B)))
(if (<= F -1.3e-207)
t_0
(if (<= F 1.65e-174)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 2e+24) t_0 (+ t_1 (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
double t_1 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.05e-7) {
tmp = t_1 + (-1.0 / sin(B));
} else if (F <= -1.3e-207) {
tmp = t_0;
} else if (F <= 1.65e-174) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 2e+24) {
tmp = t_0;
} else {
tmp = t_1 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))) t_1 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(t_1 + Float64(-1.0 / sin(B))); elseif (F <= -1.3e-207) tmp = t_0; elseif (F <= 1.65e-174) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 2e+24) tmp = t_0; else tmp = Float64(t_1 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05e-7], N[(t$95$1 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-207], t$95$0, If[LessEqual[F, 1.65e-174], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+24], t$95$0, N[(t$95$1 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;t\_1 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-207}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-174}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
if -1.05e-7 < F < -1.3e-207 or 1.65e-174 < F < 2e24Initial program 98.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.1%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites98.1%
Taylor expanded in B around 0
lower-/.f6478.5
Applied rewrites78.5%
if -1.3e-207 < F < 1.65e-174Initial program 99.5%
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.f6486.5
Applied rewrites86.5%
if 2e24 < F Initial program 54.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites65.8%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification90.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ x B))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))))
(if (<= F -1.05e-7)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F -1.3e-207)
t_0
(if (<= F 1.65e-174)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 200000.0) t_0 (/ (- 1.0 (* (cos B) x)) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
double tmp;
if (F <= -1.05e-7) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= -1.3e-207) {
tmp = t_0;
} else if (F <= 1.65e-174) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 200000.0) {
tmp = t_0;
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= -1.3e-207) tmp = t_0; elseif (F <= 1.65e-174) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 200000.0) tmp = t_0; else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05e-7], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-207], t$95$0, If[LessEqual[F, 1.65e-174], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 200000.0], t$95$0, N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-207}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-174}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 200000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
if -1.05e-7 < F < -1.3e-207 or 1.65e-174 < F < 2e5Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6478.0
Applied rewrites78.0%
if -1.3e-207 < F < 1.65e-174Initial program 99.5%
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.f6486.5
Applied rewrites86.5%
if 2e5 < F Initial program 54.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.f6499.6
Applied rewrites99.6%
Final simplification90.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ x B))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B))))
(t_1 (* (cos B) x)))
(if (<= F -1.05e-7)
(/ (- -1.0 t_1) (sin B))
(if (<= F -1.3e-207)
t_0
(if (<= F 1.65e-174)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 200000.0) t_0 (/ (- 1.0 t_1) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
double t_1 = cos(B) * x;
double tmp;
if (F <= -1.05e-7) {
tmp = (-1.0 - t_1) / sin(B);
} else if (F <= -1.3e-207) {
tmp = t_0;
} else if (F <= 1.65e-174) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 200000.0) {
tmp = t_0;
} else {
tmp = (1.0 - t_1) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))) t_1 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(-1.0 - t_1) / sin(B)); elseif (F <= -1.3e-207) tmp = t_0; elseif (F <= 1.65e-174) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 200000.0) tmp = t_0; else tmp = Float64(Float64(1.0 - t_1) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.05e-7], N[(N[(-1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-207], t$95$0, If[LessEqual[F, 1.65e-174], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 200000.0], t$95$0, N[(N[(1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1 - t\_1}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-207}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-174}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 200000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_1}{\sin B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
if -1.05e-7 < F < -1.3e-207 or 1.65e-174 < F < 2e5Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6478.0
Applied rewrites78.0%
if -1.3e-207 < F < 1.65e-174Initial program 99.5%
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.f6486.5
Applied rewrites86.5%
if 2e5 < F Initial program 54.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.f6499.6
Applied rewrites99.6%
Final simplification90.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ x B))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))))
(if (<= F -8.5e+85)
(/ (- -1.0 x) (sin B))
(if (<= F -1.3e-207)
t_0
(if (<= F 1.65e-174)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 200000.0) t_0 (/ (- 1.0 (* (cos B) x)) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
double tmp;
if (F <= -8.5e+85) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= -1.3e-207) {
tmp = t_0;
} else if (F <= 1.65e-174) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 200000.0) {
tmp = t_0;
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))) tmp = 0.0 if (F <= -8.5e+85) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= -1.3e-207) tmp = t_0; elseif (F <= 1.65e-174) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 200000.0) tmp = t_0; else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.5e+85], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-207], t$95$0, If[LessEqual[F, 1.65e-174], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 200000.0], t$95$0, N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+85}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-207}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-174}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 200000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -8.4999999999999994e85Initial program 52.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
Applied rewrites76.0%
if -8.4999999999999994e85 < F < -1.3e-207 or 1.65e-174 < F < 2e5Initial program 99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
lower-/.f6477.7
Applied rewrites77.7%
if -1.3e-207 < F < 1.65e-174Initial program 99.5%
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.f6486.5
Applied rewrites86.5%
if 2e5 < F Initial program 54.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.f6499.6
Applied rewrites99.6%
Final simplification84.5%
(FPCore (F B x)
:precision binary64
(if (<= x -3.1e-78)
(/ (* (cos B) (- x)) (sin B))
(if (<= x 3.8e-9)
(+ (- (/ x B)) (/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (x <= -3.1e-78) {
tmp = (cos(B) * -x) / sin(B);
} else if (x <= 3.8e-9) {
tmp = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -3.1e-78) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (x <= 3.8e-9) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -3.1e-78], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e-9], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-78}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-9}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if x < -3.10000000000000018e-78Initial program 72.5%
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.f6486.4
Applied rewrites86.4%
if -3.10000000000000018e-78 < x < 3.80000000000000011e-9Initial program 71.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites73.9%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites73.9%
Taylor expanded in B around 0
lower-/.f6467.9
Applied rewrites67.9%
if 3.80000000000000011e-9 < x Initial program 98.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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
Taylor expanded in F around inf
Applied rewrites94.5%
Taylor expanded in B around 0
Applied rewrites97.3%
Final simplification78.9%
(FPCore (F B x) :precision binary64 (if (or (<= x -9e-8) (not (<= x 3.8e-9))) (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)) (+ (- (/ x B)) (/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -9e-8) || !(x <= 3.8e-9)) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else {
tmp = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -9e-8) || !(x <= 3.8e-9)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); else tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -9e-8], N[Not[LessEqual[x, 3.8e-9]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-8} \lor \neg \left(x \leq 3.8 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\end{array}
\end{array}
if x < -8.99999999999999986e-8 or 3.80000000000000011e-9 < x Initial program 89.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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites98.2%
Taylor expanded in F around inf
Applied rewrites93.6%
Taylor expanded in B around 0
Applied rewrites95.9%
if -8.99999999999999986e-8 < x < 3.80000000000000011e-9Initial program 72.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites74.8%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites74.8%
Taylor expanded in B around 0
lower-/.f6467.3
Applied rewrites67.3%
Final simplification78.4%
(FPCore (F B x)
:precision binary64
(if (<= B 0.00125)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(+
(* x (/ -1.0 (tan B)))
(/
1.0
(*
B
(+
1.0
(*
(* B B)
(- (* 0.008333333333333333 (* B B)) 0.16666666666666666))))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.00125) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / (B * (1.0 + ((B * B) * ((0.008333333333333333 * (B * B)) - 0.16666666666666666)))));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.00125) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / Float64(B * Float64(1.0 + Float64(Float64(B * B) * Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666)))))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.00125], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(B * N[(1.0 + N[(N[(B * B), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.00125:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if B < 0.00125000000000000003Initial program 77.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites56.8%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6456.8
Applied rewrites56.8%
if 0.00125000000000000003 < B Initial program 83.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites83.4%
Taylor expanded in F around inf
Applied rewrites61.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6459.6
Applied rewrites59.6%
Final simplification57.4%
(FPCore (F B x)
:precision binary64
(if (<= B 0.0045)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(+
(* x (/ -1.0 (tan B)))
(/ 1.0 (* B (+ 1.0 (* -0.16666666666666666 (* B B))))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0045) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / (B * (1.0 + (-0.16666666666666666 * (B * B)))));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.0045) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * B)))))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.0045], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0045:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)}\\
\end{array}
\end{array}
if B < 0.00449999999999999966Initial program 77.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites56.8%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6456.8
Applied rewrites56.8%
if 0.00449999999999999966 < B Initial program 83.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites83.4%
Taylor expanded in F around inf
Applied rewrites61.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6459.7
Applied rewrites59.7%
Final simplification57.5%
(FPCore (F B x) :precision binary64 (if (<= B 0.02) (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B) (+ (* x (/ -1.0 (tan B))) (* (/ F B) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.02) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * (-1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.02) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.02], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.02:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if B < 0.0200000000000000004Initial program 77.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites56.8%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6456.8
Applied rewrites56.8%
if 0.0200000000000000004 < B Initial program 83.3%
Taylor expanded in F around -inf
lower-/.f6449.9
Applied rewrites49.9%
Taylor expanded in B around 0
Applied rewrites58.1%
Final simplification57.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05e-7)
(/ (- -1.0 x) (sin B))
(if (<= F 1.1e-13)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(+ (- (/ x B)) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-7) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.1e-13) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -(x / B) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.1e-13) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-7], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-13], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-13}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites75.8%
if -1.05e-7 < F < 1.09999999999999998e-13Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6453.7
Applied rewrites53.7%
if 1.09999999999999998e-13 < F Initial program 57.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites67.7%
Taylor expanded in F around inf
Applied rewrites94.1%
Taylor expanded in B around 0
lower-/.f6474.3
Applied rewrites74.3%
Final simplification64.7%
(FPCore (F B x) :precision binary64 (if (<= B 0.0045) (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B) (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0045) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.0045) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.0045], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0045:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if B < 0.00449999999999999966Initial program 77.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites56.8%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6456.8
Applied rewrites56.8%
if 0.00449999999999999966 < B Initial program 83.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites83.4%
Taylor expanded in F around inf
Applied rewrites61.7%
Taylor expanded in B around 0
Applied rewrites54.0%
Final simplification56.1%
(FPCore (F B x)
:precision binary64
(if (<= F -9.5e+238)
(/ (/ (- (* -1.0 -1.0) (* x x)) (+ -1.0 x)) B)
(if (<= F -8.5e+21)
(/ -1.0 (sin B))
(if (<= F 1.55e-10)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.5e+238) {
tmp = (((-1.0 * -1.0) - (x * x)) / (-1.0 + x)) / B;
} else if (F <= -8.5e+21) {
tmp = -1.0 / sin(B);
} else if (F <= 1.55e-10) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9.5e+238) tmp = Float64(Float64(Float64(Float64(-1.0 * -1.0) - Float64(x * x)) / Float64(-1.0 + x)) / B); elseif (F <= -8.5e+21) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.55e-10) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9.5e+238], N[(N[(N[(N[(-1.0 * -1.0), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -8.5e+21], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.55e-10], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{+238}:\\
\;\;\;\;\frac{\frac{-1 \cdot -1 - x \cdot x}{-1 + x}}{B}\\
\mathbf{elif}\;F \leq -8.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -9.5000000000000003e238Initial program 30.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.8%
Taylor expanded in F around -inf
Applied rewrites63.2%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
Applied rewrites63.8%
if -9.5000000000000003e238 < F < -8.5e21Initial program 67.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
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6462.6
Applied rewrites62.6%
if -8.5e21 < F < 1.55000000000000008e-10Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.2%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6453.2
Applied rewrites53.2%
if 1.55000000000000008e-10 < F Initial program 57.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.6%
Taylor expanded in F around inf
+-commutativeN/A
+-commutativeN/A
div-addN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
Applied rewrites49.7%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
pow2N/A
lower-*.f6449.7
Applied rewrites49.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05e-7)
(/ (- -1.0 x) (sin B))
(if (<= F 1.55e-10)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-7) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.55e-10) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.55e-10) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-7], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.55e-10], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites75.8%
if -1.05e-7 < F < 1.55000000000000008e-10Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.3%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6453.3
Applied rewrites53.3%
if 1.55000000000000008e-10 < F Initial program 57.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.6%
Taylor expanded in F around inf
+-commutativeN/A
+-commutativeN/A
div-addN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
Applied rewrites49.7%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
pow2N/A
lower-*.f6449.7
Applied rewrites49.7%
Final simplification57.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05e-7)
(/ (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (* F F))) (+ 1.0 x)) B)
(if (<= F 1.55e-10)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-7) {
tmp = ((0.5 * ((2.0 + (2.0 * x)) / (F * F))) - (1.0 + x)) / B;
} else if (F <= 1.55e-10) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(F * F))) - Float64(1.0 + x)) / B); elseif (F <= 1.55e-10) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-7], N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.55e-10], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6422.1
Applied rewrites22.1%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
lift-+.f6447.4
Applied rewrites47.4%
if -1.05e-7 < F < 1.55000000000000008e-10Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.3%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6453.3
Applied rewrites53.3%
if 1.55000000000000008e-10 < F Initial program 57.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.6%
Taylor expanded in F around inf
+-commutativeN/A
+-commutativeN/A
div-addN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
Applied rewrites49.7%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
pow2N/A
lower-*.f6449.7
Applied rewrites49.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05e-7)
(/ (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (* F F))) (+ 1.0 x)) B)
(if (<= F 1.55e-10)
(fma (/ F B) (sqrt 0.5) (/ (- x) B))
(/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-7) {
tmp = ((0.5 * ((2.0 + (2.0 * x)) / (F * F))) - (1.0 + x)) / B;
} else if (F <= 1.55e-10) {
tmp = fma((F / B), sqrt(0.5), (-x / B));
} else {
tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(F * F))) - Float64(1.0 + x)) / B); elseif (F <= 1.55e-10) tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-x) / B)); else tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-7], N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.55e-10], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{0.5 \cdot \frac{2 + 2 \cdot x}{F \cdot F} - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 61.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6422.1
Applied rewrites22.1%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
lift-+.f6447.4
Applied rewrites47.4%
if -1.05e-7 < F < 1.55000000000000008e-10Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites53.3%
Taylor expanded in F around 0
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6453.2
Applied rewrites53.2%
Taylor expanded in x around 0
Applied rewrites53.2%
if 1.55000000000000008e-10 < F Initial program 57.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.6%
Taylor expanded in F around inf
+-commutativeN/A
+-commutativeN/A
div-addN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
Applied rewrites49.7%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
pow2N/A
lower-*.f6449.7
Applied rewrites49.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1900000.0)
(/ (- -1.0 x) B)
(if (<= F 1.55e-10)
(fma (/ F B) (sqrt 0.5) (/ (- 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 <= -1900000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.55e-10) {
tmp = fma((F / B), sqrt(0.5), (-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 <= -1900000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.55e-10) tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-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, -1900000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.55e-10], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $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 -1900000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.9e6Initial program 60.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.2%
Taylor expanded in F around -inf
Applied rewrites48.8%
if -1.9e6 < F < 1.55000000000000008e-10Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.5%
Taylor expanded in F around 0
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6452.4
Applied rewrites52.4%
Taylor expanded in x around 0
Applied rewrites52.4%
if 1.55000000000000008e-10 < F Initial program 57.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.6%
Taylor expanded in F around inf
+-commutativeN/A
+-commutativeN/A
div-addN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
Applied rewrites49.7%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
pow2N/A
lower-*.f6449.7
Applied rewrites49.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1900000.0)
(/ (- -1.0 x) B)
(if (<= F 1.55e-10)
(fma (/ F B) (sqrt 0.5) (/ (- x) B))
(/ (- (fma -0.5 (/ (/ 2.0 F) F) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1900000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.55e-10) {
tmp = fma((F / B), sqrt(0.5), (-x / B));
} else {
tmp = (fma(-0.5, ((2.0 / F) / F), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1900000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.55e-10) tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-x) / B)); else tmp = Float64(Float64(fma(-0.5, Float64(Float64(2.0 / F) / F), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1900000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.55e-10], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 / F), $MachinePrecision] / F), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1900000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\frac{2}{F}}{F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.9e6Initial program 60.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.2%
Taylor expanded in F around -inf
Applied rewrites48.8%
if -1.9e6 < F < 1.55000000000000008e-10Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.5%
Taylor expanded in F around 0
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6452.4
Applied rewrites52.4%
Taylor expanded in x around 0
Applied rewrites52.4%
if 1.55000000000000008e-10 < F Initial program 57.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.6%
Taylor expanded in F around inf
+-commutativeN/A
+-commutativeN/A
div-addN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
lower-fma.f64N/A
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites49.7%
(FPCore (F B x) :precision binary64 (if (<= F -1900000.0) (/ (- -1.0 x) B) (if (<= F 1.45) (fma (/ F B) (sqrt 0.5) (/ (- x) B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1900000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.45) {
tmp = fma((F / B), sqrt(0.5), (-x / B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1900000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.45) tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-x) / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1900000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1900000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.9e6Initial program 60.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.2%
Taylor expanded in F around -inf
Applied rewrites48.8%
if -1.9e6 < F < 1.44999999999999996Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.1%
Taylor expanded in F around 0
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6452.0
Applied rewrites52.0%
Taylor expanded in x around 0
Applied rewrites52.0%
if 1.44999999999999996 < F Initial program 55.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.7%
Taylor expanded in F around inf
Applied rewrites50.3%
(FPCore (F B x)
:precision binary64
(if (<= F -2.35e-39)
(/ (- -1.0 x) B)
(if (<= F -6e-76)
(/ (* F (sqrt 0.5)) B)
(if (<= F 8.5e-76) (/ (- x) B) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-39) {
tmp = (-1.0 - x) / B;
} else if (F <= -6e-76) {
tmp = (F * sqrt(0.5)) / B;
} else if (F <= 8.5e-76) {
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.35d-39)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-6d-76)) then
tmp = (f * sqrt(0.5d0)) / b
else if (f <= 8.5d-76) 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.35e-39) {
tmp = (-1.0 - x) / B;
} else if (F <= -6e-76) {
tmp = (F * Math.sqrt(0.5)) / B;
} else if (F <= 8.5e-76) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.35e-39: tmp = (-1.0 - x) / B elif F <= -6e-76: tmp = (F * math.sqrt(0.5)) / B elif F <= 8.5e-76: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.35e-39) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -6e-76) tmp = Float64(Float64(F * sqrt(0.5)) / B); elseif (F <= 8.5e-76) 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.35e-39) tmp = (-1.0 - x) / B; elseif (F <= -6e-76) tmp = (F * sqrt(0.5)) / B; elseif (F <= 8.5e-76) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.35e-39], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -6e-76], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.5e-76], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.35 \cdot 10^{-39}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-76}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{-76}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.3500000000000001e-39Initial program 66.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites35.2%
Taylor expanded in F around -inf
Applied rewrites44.0%
if -2.3500000000000001e-39 < F < -6.00000000000000048e-76Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites67.3%
Taylor expanded in F around 0
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6467.3
Applied rewrites67.3%
Taylor expanded in x 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-eval65.5
Applied rewrites65.5%
if -6.00000000000000048e-76 < F < 8.50000000000000038e-76Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites55.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6440.9
Applied rewrites40.9%
if 8.50000000000000038e-76 < F Initial program 63.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites43.7%
(FPCore (F B x) :precision binary64 (if (<= F -2.8e-61) (/ (- -1.0 x) B) (if (<= F 8.5e-76) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-61) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.5e-76) {
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-61)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8.5d-76) 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-61) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.5e-76) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.8e-61: tmp = (-1.0 - x) / B elif F <= 8.5e-76: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.8e-61) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.5e-76) 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-61) tmp = (-1.0 - x) / B; elseif (F <= 8.5e-76) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.8e-61], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.5e-76], 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^{-61}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{-76}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.8000000000000001e-61Initial program 70.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.9%
Taylor expanded in F around -inf
Applied rewrites39.6%
if -2.8000000000000001e-61 < F < 8.50000000000000038e-76Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites55.8%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6439.8
Applied rewrites39.8%
if 8.50000000000000038e-76 < F Initial program 63.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites43.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.02e-54) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.02e-54) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.02d-54)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.02e-54) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.02e-54: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.02e-54) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.02e-54) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.02e-54], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.02 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.01999999999999999e-54Initial program 69.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.3%
Taylor expanded in F around -inf
Applied rewrites40.1%
if -1.01999999999999999e-54 < F Initial program 82.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.9%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6429.5
Applied rewrites29.5%
(FPCore (F B x) :precision binary64 (if (<= F -6.5e+90) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e+90) {
tmp = -1.0 / 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 <= (-6.5d+90)) then
tmp = (-1.0d0) / 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 <= -6.5e+90) {
tmp = -1.0 / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.5e+90: tmp = -1.0 / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.5e+90) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.5e+90) tmp = -1.0 / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.5e+90], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -6.5000000000000001e90Initial program 50.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6458.7
Applied rewrites58.7%
Taylor expanded in B around 0
Applied rewrites32.7%
if -6.5000000000000001e90 < F Initial program 85.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6427.6
Applied rewrites27.6%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / 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 = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 78.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6449.0
Applied rewrites49.0%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6416.0
Applied rewrites16.0%
Taylor expanded in B around 0
Applied rewrites9.4%
herbie shell --seed 2025060
(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))))))