VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.7%
Time: 10.4s
Alternatives: 26
Speedup: 1.6×

Specification

?
\[\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
 (+
  (- (* 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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 26 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 76.9% accurate, 1.0× speedup?

\[\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
 (+
  (- (* 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}

Alternative 1: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -250000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 210000000:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -250000000.0)
   (/ (- (fma (cos B) x 1.0)) (sin B))
   (if (<= F 210000000.0)
     (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (/ (- x) (tan B)))
     (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -250000000.0) {
		tmp = -fma(cos(B), x, 1.0) / sin(B);
	} else if (F <= 210000000.0) {
		tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / tan(B)));
	} else {
		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -250000000.0)
		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
	elseif (F <= 210000000.0)
		tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / tan(B)));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -250000000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 210000000.0], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -250000000:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

\mathbf{elif}\;F \leq 210000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.5e8

    1. Initial program 70.3%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
      2. div-add-revN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{1 + x \cdot \cos B}{\sin B}}\right) \]
      3. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
      4. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
      5. lower-neg.f64N/A

        \[\leadsto \frac{\color{blue}{-\left(1 + x \cdot \cos B\right)}}{\sin B} \]
      6. +-commutativeN/A

        \[\leadsto \frac{-\color{blue}{\left(x \cdot \cos B + 1\right)}}{\sin B} \]
      7. *-commutativeN/A

        \[\leadsto \frac{-\left(\color{blue}{\cos B \cdot x} + 1\right)}{\sin B} \]
      8. lower-fma.f64N/A

        \[\leadsto \frac{-\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
      9. lower-cos.f64N/A

        \[\leadsto \frac{-\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
      10. lower-sin.f6499.8

        \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
    5. Applied rewrites99.8%

      \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

    if -2.5e8 < F < 2.1e8

    1. Initial program 99.4%

      \[\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)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      5. lower-fma.f6499.5

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]

    if 2.1e8 < F

    1. Initial program 64.8%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6499.8

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
    5. Applied rewrites99.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -250000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 210000000:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 77.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0
         (+
          (* x (/ -1.0 (tan B)))
          (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
        (t_1
         (-
          (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B))
          (/ x (tan B)))))
   (if (<= t_0 -2e+20)
     t_1
     (if (<= t_0 10.0)
       (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
       (if (<= t_0 2e+282)
         t_1
         (+
          (/
           (-
            (*
             (fma
              (fma
               x
               0.022222222222222223
               (*
                (fma
                 (* x 0.022222222222222223)
                 -0.3333333333333333
                 (* x 0.009523809523809525))
                (* B B)))
              (* B B)
              (* 0.3333333333333333 x))
             (* B B))
            x)
           B)
          (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
	double t_1 = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
	double tmp;
	if (t_0 <= -2e+20) {
		tmp = t_1;
	} else if (t_0 <= 10.0) {
		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
	} else if (t_0 <= 2e+282) {
		tmp = t_1;
	} else {
		tmp = (((fma(fma(x, 0.022222222222222223, (fma((x * 0.022222222222222223), -0.3333333333333333, (x * 0.009523809523809525)) * (B * B))), (B * B), (0.3333333333333333 * x)) * (B * B)) - x) / B) + (1.0 / sin(B));
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
	t_1 = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B)))
	tmp = 0.0
	if (t_0 <= -2e+20)
		tmp = t_1;
	elseif (t_0 <= 10.0)
		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
	elseif (t_0 <= 2e+282)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(Float64(fma(fma(x, 0.022222222222222223, Float64(fma(Float64(x * 0.022222222222222223), -0.3333333333333333, Float64(x * 0.009523809523809525)) * Float64(B * B))), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B)) - x) / B) + Float64(1.0 / sin(B)));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+20], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], t$95$1, N[(N[(N[(N[(N[(N[(x * 0.022222222222222223 + N[(N[(N[(x * 0.022222222222222223), $MachinePrecision] * -0.3333333333333333 + N[(x * 0.009523809523809525), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{1}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e20 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2.00000000000000007e282

    1. Initial program 97.4%

      \[\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)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      5. lower-fma.f6497.4

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites97.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
    5. Applied rewrites99.0%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      4. lower-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      5. +-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      6. lower-+.f64N/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      7. lower-fma.f64N/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, {F}^{2}\right)} + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      8. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      9. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      10. lower-/.f6497.5

        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
    8. Applied rewrites97.5%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if -2e20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

    1. Initial program 79.2%

      \[\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)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      5. lower-fma.f6479.2

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites79.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
    5. Applied rewrites79.3%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    7. Step-by-step derivation
      1. lower-/.f6460.6

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    8. Applied rewrites60.6%

      \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]

    if 2.00000000000000007e282 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

    1. Initial program 28.7%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)}}{B} \]
      2. *-commutativeN/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}}}{B} \]
      3. associate-*l*N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left({B}^{2} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)} \cdot \frac{1}{6}}{B} \]
      4. associate-*r*N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{{B}^{2} \cdot \left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}\right)}}{B} \]
      5. *-commutativeN/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}}{B} \]
      6. lower-/.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
    5. Applied rewrites66.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
    8. Applied rewrites66.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]
    9. Taylor expanded in F around inf

      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(x, \frac{1}{45}, \mathsf{fma}\left(x \cdot \frac{1}{45}, \frac{-1}{3}, x \cdot \frac{1}{105}\right) \cdot \left(B \cdot B\right)\right), B \cdot B, \frac{1}{3} \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \color{blue}{\frac{1}{\sin B}} \]
    10. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(x, \frac{1}{45}, \mathsf{fma}\left(x \cdot \frac{1}{45}, \frac{-1}{3}, x \cdot \frac{1}{105}\right) \cdot \left(B \cdot B\right)\right), B \cdot B, \frac{1}{3} \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \color{blue}{\frac{1}{\sin B}} \]
      2. lower-sin.f6482.9

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{1}{\color{blue}{\sin B}} \]
    11. Applied rewrites82.9%

      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq -2 \cdot 10^{+20}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq 10:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq 2 \cdot 10^{+282}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 77.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0
         (+
          (* x (/ -1.0 (tan B)))
          (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
        (t_1
         (-
          (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B))
          (/ x (tan B)))))
   (if (<= t_0 -2e+20)
     t_1
     (if (<= t_0 10.0)
       (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
       (if (<= t_0 2e+282) t_1 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
	double t_1 = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
	double tmp;
	if (t_0 <= -2e+20) {
		tmp = t_1;
	} else if (t_0 <= 10.0) {
		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
	} else if (t_0 <= 2e+282) {
		tmp = t_1;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
	t_1 = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B)))
	tmp = 0.0
	if (t_0 <= -2e+20)
		tmp = t_1;
	elseif (t_0 <= 10.0)
		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
	elseif (t_0 <= 2e+282)
		tmp = t_1;
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+20], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+282], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e20 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2.00000000000000007e282

    1. Initial program 97.4%

      \[\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)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      5. lower-fma.f6497.4

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites97.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
    5. Applied rewrites99.0%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      3. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      4. lower-/.f64N/A

        \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      5. +-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      6. lower-+.f64N/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      7. lower-fma.f64N/A

        \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, {F}^{2}\right)} + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      8. unpow2N/A

        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      9. lower-*.f64N/A

        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
      10. lower-/.f6497.5

        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
    8. Applied rewrites97.5%

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

    if -2e20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

    1. Initial program 79.2%

      \[\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)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\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)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      5. lower-fma.f6479.2

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites79.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
    5. Applied rewrites79.3%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
    6. Taylor expanded in B around 0

      \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    7. Step-by-step derivation
      1. lower-/.f6460.6

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    8. Applied rewrites60.6%

      \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]

    if 2.00000000000000007e282 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

    1. Initial program 28.7%

      \[\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)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
      2. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
      3. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
      7. associate-+r+N/A

        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
      8. +-commutativeN/A

        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
      9. unpow2N/A

        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
      10. lower-fma.f64N/A

        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
      11. +-commutativeN/A

        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
      12. lower-fma.f6466.7

        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
    5. Applied rewrites66.7%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
    6. Taylor expanded in F around inf

      \[\leadsto \frac{1 - x}{B} \]
    7. Step-by-step derivation
      1. Applied rewrites82.9%

        \[\leadsto \frac{1 - x}{B} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification82.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq -2 \cdot 10^{+20}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq 10:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq 2 \cdot 10^{+282}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 4: 99.6% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -250000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 210000000:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -250000000.0)
       (/ (- (fma (cos B) x 1.0)) (sin B))
       (if (<= F 210000000.0)
         (fma (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)) (/ (- x) (tan B)))
         (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -250000000.0) {
    		tmp = -fma(cos(B), x, 1.0) / sin(B);
    	} else if (F <= 210000000.0) {
    		tmp = fma(sqrt((1.0 / fma(F, F, 2.0))), (F / sin(B)), (-x / tan(B)));
    	} else {
    		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -250000000.0)
    		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
    	elseif (F <= 210000000.0)
    		tmp = fma(sqrt(Float64(1.0 / fma(F, F, 2.0))), Float64(F / sin(B)), Float64(Float64(-x) / tan(B)));
    	else
    		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -250000000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 210000000.0], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -250000000:\\
    \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
    
    \mathbf{elif}\;F \leq 210000000:\\
    \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -2.5e8

      1. Initial program 70.3%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
        2. div-add-revN/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{1 + x \cdot \cos B}{\sin B}}\right) \]
        3. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        5. lower-neg.f64N/A

          \[\leadsto \frac{\color{blue}{-\left(1 + x \cdot \cos B\right)}}{\sin B} \]
        6. +-commutativeN/A

          \[\leadsto \frac{-\color{blue}{\left(x \cdot \cos B + 1\right)}}{\sin B} \]
        7. *-commutativeN/A

          \[\leadsto \frac{-\left(\color{blue}{\cos B \cdot x} + 1\right)}{\sin B} \]
        8. lower-fma.f64N/A

          \[\leadsto \frac{-\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
        9. lower-cos.f64N/A

          \[\leadsto \frac{-\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
        10. lower-sin.f6499.8

          \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.8%

        \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

      if -2.5e8 < F < 2.1e8

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6499.5

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      6. Step-by-step derivation
        1. lower-sqrt.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
        2. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + {F}^{2}}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
        5. lower-fma.f6499.6

          \[\leadsto \mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]
      7. Applied rewrites99.6%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right) \]

      if 2.1e8 < F

      1. Initial program 64.8%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
        2. lower-sin.f6499.8

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.8%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification99.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -250000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 210000000:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 99.7% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+30}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 50000000:\\ \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -5e+30)
       (/ (- (fma (cos B) x 1.0)) (sin B))
       (if (<= F 50000000.0)
         (- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B))) (/ x (tan B)))
         (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -5e+30) {
    		tmp = -fma(cos(B), x, 1.0) / sin(B);
    	} else if (F <= 50000000.0) {
    		tmp = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))) - (x / tan(B));
    	} else {
    		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -5e+30)
    		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
    	elseif (F <= 50000000.0)
    		tmp = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))) - Float64(x / tan(B)));
    	else
    		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -5e+30], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 50000000.0], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -5 \cdot 10^{+30}:\\
    \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
    
    \mathbf{elif}\;F \leq 50000000:\\
    \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\tan B}\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -4.9999999999999998e30

      1. Initial program 68.1%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
        2. div-add-revN/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{1 + x \cdot \cos B}{\sin B}}\right) \]
        3. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        5. lower-neg.f64N/A

          \[\leadsto \frac{\color{blue}{-\left(1 + x \cdot \cos B\right)}}{\sin B} \]
        6. +-commutativeN/A

          \[\leadsto \frac{-\color{blue}{\left(x \cdot \cos B + 1\right)}}{\sin B} \]
        7. *-commutativeN/A

          \[\leadsto \frac{-\left(\color{blue}{\cos B \cdot x} + 1\right)}{\sin B} \]
        8. lower-fma.f64N/A

          \[\leadsto \frac{-\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
        9. lower-cos.f64N/A

          \[\leadsto \frac{-\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
        10. lower-sin.f6499.8

          \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.8%

        \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

      if -4.9999999999999998e30 < F < 5e7

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6499.4

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites99.5%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}} - \frac{x}{\tan B} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}}{\sin B} - \frac{x}{\tan B} \]
        3. associate-/l/N/A

          \[\leadsto \color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
        5. lift-sqrt.f64N/A

          \[\leadsto \frac{F}{\color{blue}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
        6. lift-fma.f64N/A

          \[\leadsto \frac{F}{\sqrt{\color{blue}{x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
        7. *-commutativeN/A

          \[\leadsto \frac{F}{\sqrt{\color{blue}{2 \cdot x} + \mathsf{fma}\left(F, F, 2\right)} \cdot \sin B} - \frac{x}{\tan B} \]
        8. lift-fma.f64N/A

          \[\leadsto \frac{F}{\sqrt{2 \cdot x + \color{blue}{\left(F \cdot F + 2\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
        9. lower-*.f64N/A

          \[\leadsto \frac{F}{\color{blue}{\sqrt{2 \cdot x + \left(F \cdot F + 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
        10. lower-sqrt.f64N/A

          \[\leadsto \frac{F}{\color{blue}{\sqrt{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
        11. lift-fma.f64N/A

          \[\leadsto \frac{F}{\sqrt{2 \cdot x + \color{blue}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
        12. lower-fma.f6499.6

          \[\leadsto \frac{F}{\sqrt{\color{blue}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \sin B} - \frac{x}{\tan B} \]
      7. Applied rewrites99.6%

        \[\leadsto \color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}} - \frac{x}{\tan B} \]

      if 5e7 < F

      1. Initial program 64.8%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
        2. lower-sin.f6499.8

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.8%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification99.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+30}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 50000000:\\ \;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 91.4% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, -\frac{x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -9e-5)
       (/ (- (fma (cos B) x 1.0)) (sin B))
       (if (<= F 3.5e-185)
         (- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
         (if (<= F 2.3e-9)
           (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (- (/ x B)))
           (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -9e-5) {
    		tmp = -fma(cos(B), x, 1.0) / sin(B);
    	} else if (F <= 3.5e-185) {
    		tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
    	} else if (F <= 2.3e-9) {
    		tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), -(x / B));
    	} else {
    		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -9e-5)
    		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
    	elseif (F <= 3.5e-185)
    		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B)));
    	elseif (F <= 2.3e-9)
    		tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(-Float64(x / B)));
    	else
    		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
    \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
    
    \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
    \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
    
    \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
    \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, -\frac{x}{B}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if F < -9.00000000000000057e-5

      1. Initial program 72.3%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
        2. div-add-revN/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{1 + x \cdot \cos B}{\sin B}}\right) \]
        3. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        5. lower-neg.f64N/A

          \[\leadsto \frac{\color{blue}{-\left(1 + x \cdot \cos B\right)}}{\sin B} \]
        6. +-commutativeN/A

          \[\leadsto \frac{-\color{blue}{\left(x \cdot \cos B + 1\right)}}{\sin B} \]
        7. *-commutativeN/A

          \[\leadsto \frac{-\left(\color{blue}{\cos B \cdot x} + 1\right)}{\sin B} \]
        8. lower-fma.f64N/A

          \[\leadsto \frac{-\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
        9. lower-cos.f64N/A

          \[\leadsto \frac{-\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
        10. lower-sin.f6497.5

          \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
      5. Applied rewrites97.5%

        \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

      if -9.00000000000000057e-5 < F < 3.4999999999999998e-185

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6499.5

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites99.7%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Taylor expanded in B around 0

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} - \frac{x}{\tan B} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        5. +-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        6. lower-+.f64N/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        7. lower-fma.f64N/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, {F}^{2}\right)} + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        8. unpow2N/A

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        9. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        10. lower-/.f6488.6

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
      8. Applied rewrites88.6%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

      if 3.4999999999999998e-185 < F < 2.2999999999999999e-9

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in B around 0

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      4. Step-by-step derivation
        1. lower-/.f6486.1

          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      5. Applied rewrites86.1%

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      6. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-\frac{x}{B}\right)} \]
      7. Applied rewrites86.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, -\frac{x}{B}\right)} \]

      if 2.2999999999999999e-9 < F

      1. Initial program 66.1%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
        2. lower-sin.f6499.3

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.3%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification94.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, -\frac{x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 91.4% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -9e-5)
       (/ (- (fma (cos B) x 1.0)) (sin B))
       (if (<= F 3.5e-185)
         (- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
         (if (<= F 2.3e-9)
           (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
           (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -9e-5) {
    		tmp = -fma(cos(B), x, 1.0) / sin(B);
    	} else if (F <= 3.5e-185) {
    		tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
    	} else if (F <= 2.3e-9) {
    		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
    	} else {
    		tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -9e-5)
    		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
    	elseif (F <= 3.5e-185)
    		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B)));
    	elseif (F <= 2.3e-9)
    		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
    	else
    		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B)));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
    \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
    
    \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
    \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
    
    \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if F < -9.00000000000000057e-5

      1. Initial program 72.3%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
        2. div-add-revN/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{1 + x \cdot \cos B}{\sin B}}\right) \]
        3. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        5. lower-neg.f64N/A

          \[\leadsto \frac{\color{blue}{-\left(1 + x \cdot \cos B\right)}}{\sin B} \]
        6. +-commutativeN/A

          \[\leadsto \frac{-\color{blue}{\left(x \cdot \cos B + 1\right)}}{\sin B} \]
        7. *-commutativeN/A

          \[\leadsto \frac{-\left(\color{blue}{\cos B \cdot x} + 1\right)}{\sin B} \]
        8. lower-fma.f64N/A

          \[\leadsto \frac{-\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
        9. lower-cos.f64N/A

          \[\leadsto \frac{-\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
        10. lower-sin.f6497.5

          \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
      5. Applied rewrites97.5%

        \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

      if -9.00000000000000057e-5 < F < 3.4999999999999998e-185

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6499.5

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites99.7%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Taylor expanded in B around 0

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} - \frac{x}{\tan B} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        5. +-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        6. lower-+.f64N/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        7. lower-fma.f64N/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, {F}^{2}\right)} + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        8. unpow2N/A

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        9. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        10. lower-/.f6488.6

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
      8. Applied rewrites88.6%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

      if 3.4999999999999998e-185 < F < 2.2999999999999999e-9

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6499.5

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites99.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Taylor expanded in B around 0

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      7. Step-by-step derivation
        1. lower-/.f6486.0

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      8. Applied rewrites86.0%

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]

      if 2.2999999999999999e-9 < F

      1. Initial program 66.1%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
        2. lower-sin.f6499.3

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.3%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification94.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 91.4% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -9e-5)
       (/ (- (fma (cos B) x 1.0)) (sin B))
       (if (<= F 3.5e-185)
         (- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
         (if (<= F 2.3e-9)
           (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
           (/ (fma -1.0 (* (cos B) x) 1.0) (sin B))))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -9e-5) {
    		tmp = -fma(cos(B), x, 1.0) / sin(B);
    	} else if (F <= 3.5e-185) {
    		tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
    	} else if (F <= 2.3e-9) {
    		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
    	} else {
    		tmp = fma(-1.0, (cos(B) * x), 1.0) / sin(B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -9e-5)
    		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
    	elseif (F <= 3.5e-185)
    		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B)));
    	elseif (F <= 2.3e-9)
    		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
    	else
    		tmp = Float64(fma(-1.0, Float64(cos(B) * x), 1.0) / sin(B));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
    \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
    
    \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
    \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
    
    \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if F < -9.00000000000000057e-5

      1. Initial program 72.3%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
        2. div-add-revN/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{1 + x \cdot \cos B}{\sin B}}\right) \]
        3. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        4. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
        5. lower-neg.f64N/A

          \[\leadsto \frac{\color{blue}{-\left(1 + x \cdot \cos B\right)}}{\sin B} \]
        6. +-commutativeN/A

          \[\leadsto \frac{-\color{blue}{\left(x \cdot \cos B + 1\right)}}{\sin B} \]
        7. *-commutativeN/A

          \[\leadsto \frac{-\left(\color{blue}{\cos B \cdot x} + 1\right)}{\sin B} \]
        8. lower-fma.f64N/A

          \[\leadsto \frac{-\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
        9. lower-cos.f64N/A

          \[\leadsto \frac{-\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
        10. lower-sin.f6497.5

          \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
      5. Applied rewrites97.5%

        \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

      if -9.00000000000000057e-5 < F < 3.4999999999999998e-185

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6499.5

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites99.7%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Taylor expanded in B around 0

        \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} - \frac{x}{\tan B} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
        3. lower-sqrt.f64N/A

          \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        4. lower-/.f64N/A

          \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        5. +-commutativeN/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        6. lower-+.f64N/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        7. lower-fma.f64N/A

          \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, {F}^{2}\right)} + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        8. unpow2N/A

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        9. lower-*.f64N/A

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
        10. lower-/.f6488.6

          \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
      8. Applied rewrites88.6%

        \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

      if 3.4999999999999998e-185 < F < 2.2999999999999999e-9

      1. Initial program 99.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6499.5

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites99.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Taylor expanded in B around 0

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      7. Step-by-step derivation
        1. lower-/.f6486.0

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      8. Applied rewrites86.0%

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]

      if 2.2999999999999999e-9 < F

      1. Initial program 66.1%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6466.1

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites66.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Taylor expanded in F around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
      6. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \cos B\right)}{\sin B}} + \frac{1}{\sin B} \]
        2. div-add-revN/A

          \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \cos B\right) + 1}{\sin B}} \]
        3. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot \cos B\right) + 1}{\sin B}} \]
        4. lower-fma.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \cos B, 1\right)}}{\sin B} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\cos B \cdot x}, 1\right)}{\sin B} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\cos B \cdot x}, 1\right)}{\sin B} \]
        7. lower-cos.f64N/A

          \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\cos B} \cdot x, 1\right)}{\sin B} \]
        8. lower-sin.f6499.2

          \[\leadsto \frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\color{blue}{\sin B}} \]
      7. Applied rewrites99.2%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification94.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 77.6% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+24} \lor \neg \left(x \leq 3.6 \cdot 10^{-6}\right):\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (or (<= x -6.5e+24) (not (<= x 3.6e-6)))
       (* (- x) (/ (cos B) (sin B)))
       (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))))
    double code(double F, double B, double x) {
    	double tmp;
    	if ((x <= -6.5e+24) || !(x <= 3.6e-6)) {
    		tmp = -x * (cos(B) / sin(B));
    	} else {
    		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if ((x <= -6.5e+24) || !(x <= 3.6e-6))
    		tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B)));
    	else
    		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[Or[LessEqual[x, -6.5e+24], N[Not[LessEqual[x, 3.6e-6]], $MachinePrecision]], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -6.5 \cdot 10^{+24} \lor \neg \left(x \leq 3.6 \cdot 10^{-6}\right):\\
    \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -6.4999999999999996e24 or 3.59999999999999984e-6 < x

      1. Initial program 87.0%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around 0

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{\cos B}{\sin B}}\right) \]
        3. distribute-lft-neg-inN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
        5. lower-neg.f64N/A

          \[\leadsto \color{blue}{\left(-x\right)} \cdot \frac{\cos B}{\sin B} \]
        6. lower-/.f64N/A

          \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{\cos B}{\sin B}} \]
        7. lower-cos.f64N/A

          \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
        8. lower-sin.f6498.6

          \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
      5. Applied rewrites98.6%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]

      if -6.4999999999999996e24 < x < 3.59999999999999984e-6

      1. Initial program 78.0%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6478.0

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites78.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites80.1%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Taylor expanded in B around 0

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      7. Step-by-step derivation
        1. lower-/.f6469.7

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      8. Applied rewrites69.7%

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification81.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+24} \lor \neg \left(x \leq 3.6 \cdot 10^{-6}\right):\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 77.6% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+24}:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos B \cdot x}{-\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= x -6.5e+24)
       (* (- x) (/ (cos B) (sin B)))
       (if (<= x 3.6e-6)
         (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
         (/ (* (cos B) x) (- (sin B))))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (x <= -6.5e+24) {
    		tmp = -x * (cos(B) / sin(B));
    	} else if (x <= 3.6e-6) {
    		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
    	} else {
    		tmp = (cos(B) * x) / -sin(B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (x <= -6.5e+24)
    		tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B)));
    	elseif (x <= 3.6e-6)
    		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
    	else
    		tmp = Float64(Float64(cos(B) * x) / Float64(-sin(B)));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[x, -6.5e+24], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6e-6], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -6.5 \cdot 10^{+24}:\\
    \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\
    
    \mathbf{elif}\;x \leq 3.6 \cdot 10^{-6}:\\
    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\cos B \cdot x}{-\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -6.4999999999999996e24

      1. Initial program 70.4%

        \[\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)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around 0

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{\cos B}{\sin B}}\right) \]
        3. distribute-lft-neg-inN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
        5. lower-neg.f64N/A

          \[\leadsto \color{blue}{\left(-x\right)} \cdot \frac{\cos B}{\sin B} \]
        6. lower-/.f64N/A

          \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{\cos B}{\sin B}} \]
        7. lower-cos.f64N/A

          \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
        8. lower-sin.f6499.5

          \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
      5. Applied rewrites99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]

      if -6.4999999999999996e24 < x < 3.59999999999999984e-6

      1. Initial program 78.0%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\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)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. lower-fma.f6478.0

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites78.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
      5. Applied rewrites80.1%

        \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
      6. Taylor expanded in B around 0

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      7. Step-by-step derivation
        1. lower-/.f6469.7

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
      8. Applied rewrites69.7%

        \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]

      if 3.59999999999999984e-6 < x

      1. Initial program 92.0%

        \[\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)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
        2. lift-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        3. associate-*l/N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
        4. lower-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
        5. *-commutativeN/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
        6. lower-*.f6498.4

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
        7. lift-+.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
        8. +-commutativeN/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
        9. lift-*.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
        10. lower-fma.f6498.4

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
        11. lift-+.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F + 2}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
        12. lift-*.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
        13. lower-fma.f6498.4

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
        14. lift-neg.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot F}{\sin B} \]
        15. lift-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
        16. metadata-evalN/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
        17. metadata-eval98.4

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}} \cdot F}{\sin B} \]
      4. Applied rewrites98.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B}} \]
      5. Taylor expanded in F around -inf

        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
        2. lower-neg.f64N/A

          \[\leadsto \color{blue}{-\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
        3. +-commutativeN/A

          \[\leadsto -\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)} \]
        4. div-add-revN/A

          \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
        5. lower-/.f64N/A

          \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
        6. *-commutativeN/A

          \[\leadsto -\frac{\color{blue}{\cos B \cdot x} + 1}{\sin B} \]
        7. lower-fma.f64N/A

          \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
        8. lower-cos.f64N/A

          \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
        9. lower-sin.f6496.3

          \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
      7. Applied rewrites96.3%

        \[\leadsto \color{blue}{-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]
      8. Taylor expanded in x around inf

        \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
      9. Step-by-step derivation
        1. Applied rewrites98.5%

          \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
      10. Recombined 3 regimes into one program.
      11. Final simplification81.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{+24}:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos B \cdot x}{-\sin B}\\ \end{array} \]
      12. Add Preprocessing

      Alternative 11: 84.0% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (if (<= F -9e-5)
         (/ (- (fma (cos B) x 1.0)) (sin B))
         (if (<= F 3.5e-185)
           (- (* (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) (/ F B)) (/ x (tan B)))
           (if (<= F 2.5e+154)
             (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
             (+
              (* x (/ -1.0 (tan B)))
              (/ (fma (* B B) 0.16666666666666666 1.0) B))))))
      double code(double F, double B, double x) {
      	double tmp;
      	if (F <= -9e-5) {
      		tmp = -fma(cos(B), x, 1.0) / sin(B);
      	} else if (F <= 3.5e-185) {
      		tmp = (sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) * (F / B)) - (x / tan(B));
      	} else if (F <= 2.5e+154) {
      		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
      	} else {
      		tmp = (x * (-1.0 / tan(B))) + (fma((B * B), 0.16666666666666666, 1.0) / B);
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	tmp = 0.0
      	if (F <= -9e-5)
      		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
      	elseif (F <= 3.5e-185)
      		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * Float64(F / B)) - Float64(x / tan(B)));
      	elseif (F <= 2.5e+154)
      		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
      	else
      		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B));
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-185], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e+154], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
      \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
      
      \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\
      \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
      
      \mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\
      \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if F < -9.00000000000000057e-5

        1. Initial program 72.3%

          \[\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)} \]
        2. Add Preprocessing
        3. Taylor expanded in F around -inf

          \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
          2. div-add-revN/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{1 + x \cdot \cos B}{\sin B}}\right) \]
          3. distribute-neg-fracN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
          4. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(1 + x \cdot \cos B\right)\right)}{\sin B}} \]
          5. lower-neg.f64N/A

            \[\leadsto \frac{\color{blue}{-\left(1 + x \cdot \cos B\right)}}{\sin B} \]
          6. +-commutativeN/A

            \[\leadsto \frac{-\color{blue}{\left(x \cdot \cos B + 1\right)}}{\sin B} \]
          7. *-commutativeN/A

            \[\leadsto \frac{-\left(\color{blue}{\cos B \cdot x} + 1\right)}{\sin B} \]
          8. lower-fma.f64N/A

            \[\leadsto \frac{-\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
          9. lower-cos.f64N/A

            \[\leadsto \frac{-\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
          10. lower-sin.f6497.5

            \[\leadsto \frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
        5. Applied rewrites97.5%

          \[\leadsto \color{blue}{\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]

        if -9.00000000000000057e-5 < F < 3.4999999999999998e-185

        1. Initial program 99.4%

          \[\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)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\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)}} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          5. lower-fma.f6499.5

            \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
        4. Applied rewrites99.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
        5. Applied rewrites99.7%

          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
        6. Taylor expanded in B around 0

          \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} - \frac{x}{\tan B} \]
        7. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
          4. lower-/.f64N/A

            \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
          5. +-commutativeN/A

            \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
          6. lower-+.f64N/A

            \[\leadsto \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
          7. lower-fma.f64N/A

            \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(2, x, {F}^{2}\right)} + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
          8. unpow2N/A

            \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
          9. lower-*.f64N/A

            \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \color{blue}{F \cdot F}\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
          10. lower-/.f6488.6

            \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
        8. Applied rewrites88.6%

          \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]

        if 3.4999999999999998e-185 < F < 2.50000000000000002e154

        1. Initial program 94.0%

          \[\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)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\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)}} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          5. lower-fma.f6494.1

            \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
        4. Applied rewrites94.1%

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
        5. Applied rewrites98.3%

          \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
        6. Taylor expanded in B around 0

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
        7. Step-by-step derivation
          1. lower-/.f6481.4

            \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
        8. Applied rewrites81.4%

          \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]

        if 2.50000000000000002e154 < F

        1. Initial program 37.9%

          \[\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)} \]
        2. Add Preprocessing
        3. Taylor expanded in B around 0

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)}}{B} \]
          2. *-commutativeN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}}}{B} \]
          3. associate-*l*N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left({B}^{2} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)} \cdot \frac{1}{6}}{B} \]
          4. associate-*r*N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{{B}^{2} \cdot \left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}\right)}}{B} \]
          5. *-commutativeN/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}}{B} \]
          6. lower-/.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
        5. Applied rewrites23.9%

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}} \]
        6. Taylor expanded in F around inf

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1 + \frac{1}{6} \cdot {B}^{2}}{B} \]
        7. Step-by-step derivation
          1. Applied rewrites61.1%

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} \]
        8. Recombined 4 regimes into one program.
        9. Final simplification85.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-185}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 12: 70.7% accurate, 2.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+35}:\\ \;\;\;\;\frac{1 + x}{-\sin B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (if (<= F -1e+35)
           (/ (+ 1.0 x) (- (sin B)))
           (if (<= F 2.5e+154)
             (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
             (+ (* x (/ -1.0 (tan B))) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
        double code(double F, double B, double x) {
        	double tmp;
        	if (F <= -1e+35) {
        		tmp = (1.0 + x) / -sin(B);
        	} else if (F <= 2.5e+154) {
        		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
        	} else {
        		tmp = (x * (-1.0 / tan(B))) + (fma((B * B), 0.16666666666666666, 1.0) / B);
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	tmp = 0.0
        	if (F <= -1e+35)
        		tmp = Float64(Float64(1.0 + x) / Float64(-sin(B)));
        	elseif (F <= 2.5e+154)
        		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B));
        	else
        		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B));
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := If[LessEqual[F, -1e+35], N[(N[(1.0 + x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 2.5e+154], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;F \leq -1 \cdot 10^{+35}:\\
        \;\;\;\;\frac{1 + x}{-\sin B}\\
        
        \mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\
        \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
        
        \mathbf{else}:\\
        \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if F < -9.9999999999999997e34

          1. Initial program 66.6%

            \[\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)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
            2. lift-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            3. associate-*l/N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
            4. lower-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
            5. *-commutativeN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
            6. lower-*.f6476.4

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
            7. lift-+.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
            8. +-commutativeN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
            9. lift-*.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
            10. lower-fma.f6476.4

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
            11. lift-+.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F + 2}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
            12. lift-*.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
            13. lower-fma.f6476.4

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
            14. lift-neg.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot F}{\sin B} \]
            15. lift-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
            16. metadata-evalN/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
            17. metadata-eval76.4

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}} \cdot F}{\sin B} \]
          4. Applied rewrites76.4%

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B}} \]
          5. Taylor expanded in F around -inf

            \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
          6. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
            2. lower-neg.f64N/A

              \[\leadsto \color{blue}{-\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
            3. +-commutativeN/A

              \[\leadsto -\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)} \]
            4. div-add-revN/A

              \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
            5. lower-/.f64N/A

              \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
            6. *-commutativeN/A

              \[\leadsto -\frac{\color{blue}{\cos B \cdot x} + 1}{\sin B} \]
            7. lower-fma.f64N/A

              \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
            8. lower-cos.f64N/A

              \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
            9. lower-sin.f6499.7

              \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
          7. Applied rewrites99.7%

            \[\leadsto \color{blue}{-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]
          8. Taylor expanded in B around 0

            \[\leadsto -\frac{1 + x}{\sin B} \]
          9. Step-by-step derivation
            1. Applied rewrites76.8%

              \[\leadsto -\frac{1 + x}{\sin B} \]

            if -9.9999999999999997e34 < F < 2.50000000000000002e154

            1. Initial program 97.0%

              \[\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)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{\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)}} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              4. *-commutativeN/A

                \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              5. lower-fma.f6497.1

                \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
            4. Applied rewrites97.2%

              \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
            5. Applied rewrites99.1%

              \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{\tan B}} \]
            6. Taylor expanded in B around 0

              \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
            7. Step-by-step derivation
              1. lower-/.f6476.4

                \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]
            8. Applied rewrites76.4%

              \[\leadsto \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \color{blue}{\frac{x}{B}} \]

            if 2.50000000000000002e154 < F

            1. Initial program 37.9%

              \[\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)} \]
            2. Add Preprocessing
            3. Taylor expanded in B around 0

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)}}{B} \]
              2. *-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}}}{B} \]
              3. associate-*l*N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left({B}^{2} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)} \cdot \frac{1}{6}}{B} \]
              4. associate-*r*N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{{B}^{2} \cdot \left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}\right)}}{B} \]
              5. *-commutativeN/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}}{B} \]
              6. lower-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
            5. Applied rewrites23.9%

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}} \]
            6. Taylor expanded in F around inf

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1 + \frac{1}{6} \cdot {B}^{2}}{B} \]
            7. Step-by-step derivation
              1. Applied rewrites61.1%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} \]
            8. Recombined 3 regimes into one program.
            9. Final simplification74.4%

              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+35}:\\ \;\;\;\;\frac{1 + x}{-\sin B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{+154}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\ \end{array} \]
            10. Add Preprocessing

            Alternative 13: 60.3% accurate, 2.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\ \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{1 + x}{-\sin B}\\ \mathbf{elif}\;F \leq 4.25 \cdot 10^{-162}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-9}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
               (if (<= F -9e-5)
                 (/ (+ 1.0 x) (- (sin B)))
                 (if (<= F 4.25e-162)
                   (/
                    (fma
                     t_0
                     F
                     (-
                      (*
                       (fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
                       (* B B))
                      x))
                    B)
                   (if (<= F 2.2e-9)
                     (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
                     (+
                      (* x (/ -1.0 (tan B)))
                      (/ (fma (* B B) 0.16666666666666666 1.0) B)))))))
            double code(double F, double B, double x) {
            	double t_0 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
            	double tmp;
            	if (F <= -9e-5) {
            		tmp = (1.0 + x) / -sin(B);
            	} else if (F <= 4.25e-162) {
            		tmp = fma(t_0, F, ((fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)) * (B * B)) - x)) / B;
            	} else if (F <= 2.2e-9) {
            		tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
            	} else {
            		tmp = (x * (-1.0 / tan(B))) + (fma((B * B), 0.16666666666666666, 1.0) / B);
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0)))
            	tmp = 0.0
            	if (F <= -9e-5)
            		tmp = Float64(Float64(1.0 + x) / Float64(-sin(B)));
            	elseif (F <= 4.25e-162)
            		tmp = Float64(fma(t_0, F, Float64(Float64(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)) * Float64(B * B)) - x)) / B);
            	elseif (F <= 2.2e-9)
            		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B)));
            	else
            		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B));
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -9e-5], N[(N[(1.0 + x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 4.25e-162], N[(N[(t$95$0 * F + N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e-9], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
            \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
            \;\;\;\;\frac{1 + x}{-\sin B}\\
            
            \mathbf{elif}\;F \leq 4.25 \cdot 10^{-162}:\\
            \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\
            
            \mathbf{elif}\;F \leq 2.2 \cdot 10^{-9}:\\
            \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if F < -9.00000000000000057e-5

              1. Initial program 72.3%

                \[\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)} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                2. lift-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                3. associate-*l/N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
                4. lower-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
                5. *-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
                6. lower-*.f6480.4

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
                7. lift-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                8. +-commutativeN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                9. lift-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                10. lower-fma.f6480.4

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                11. lift-+.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F + 2}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                12. lift-*.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                13. lower-fma.f6480.4

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                14. lift-neg.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot F}{\sin B} \]
                15. lift-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
                16. metadata-evalN/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
                17. metadata-eval80.4

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}} \cdot F}{\sin B} \]
              4. Applied rewrites80.4%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B}} \]
              5. Taylor expanded in F around -inf

                \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
              6. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                2. lower-neg.f64N/A

                  \[\leadsto \color{blue}{-\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                3. +-commutativeN/A

                  \[\leadsto -\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)} \]
                4. div-add-revN/A

                  \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
                5. lower-/.f64N/A

                  \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
                6. *-commutativeN/A

                  \[\leadsto -\frac{\color{blue}{\cos B \cdot x} + 1}{\sin B} \]
                7. lower-fma.f64N/A

                  \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
                8. lower-cos.f64N/A

                  \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
                9. lower-sin.f6497.5

                  \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
              7. Applied rewrites97.5%

                \[\leadsto \color{blue}{-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]
              8. Taylor expanded in B around 0

                \[\leadsto -\frac{1 + x}{\sin B} \]
              9. Step-by-step derivation
                1. Applied rewrites75.4%

                  \[\leadsto -\frac{1 + x}{\sin B} \]

                if -9.00000000000000057e-5 < F < 4.24999999999999977e-162

                1. Initial program 99.4%

                  \[\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)} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                  2. lift-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  3. associate-*l/N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
                  4. lower-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
                  5. *-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
                  6. lower-*.f6499.6

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
                  7. lift-+.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                  8. +-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                  9. lift-*.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                  10. lower-fma.f6499.6

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                  11. lift-+.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F + 2}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                  12. lift-*.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                  13. lower-fma.f6499.6

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                  14. lift-neg.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot F}{\sin B} \]
                  15. lift-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
                  16. metadata-evalN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
                  17. metadata-eval99.6

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}} \cdot F}{\sin B} \]
                4. Applied rewrites99.6%

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B}} \]
                5. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                6. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                7. Applied rewrites62.6%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}} \]

                if 4.24999999999999977e-162 < F < 2.1999999999999998e-9

                1. Initial program 99.5%

                  \[\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)} \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
                  4. lower-/.f64N/A

                    \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
                  5. +-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}} \cdot \frac{F}{\sin B} \]
                  6. unpow2N/A

                    \[\leadsto \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{F}{\sin B} \]
                  7. lower-fma.f64N/A

                    \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}} \cdot \frac{F}{\sin B} \]
                  8. lower-/.f64N/A

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  9. lower-sin.f6470.8

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                5. Applied rewrites70.8%

                  \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}} \]

                if 2.1999999999999998e-9 < F

                1. Initial program 66.1%

                  \[\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)} \]
                2. Add Preprocessing
                3. Taylor expanded in B around 0

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)}}{B} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}}}{B} \]
                  3. associate-*l*N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left({B}^{2} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)} \cdot \frac{1}{6}}{B} \]
                  4. associate-*r*N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{{B}^{2} \cdot \left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}\right)}}{B} \]
                  5. *-commutativeN/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}}{B} \]
                  6. lower-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
                5. Applied rewrites45.8%

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}} \]
                6. Taylor expanded in F around inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1 + \frac{1}{6} \cdot {B}^{2}}{B} \]
                7. Step-by-step derivation
                  1. Applied rewrites62.4%

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} \]
                8. Recombined 4 regimes into one program.
                9. Final simplification67.1%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{1 + x}{-\sin B}\\ \mathbf{elif}\;F \leq 4.25 \cdot 10^{-162}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-9}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\ \end{array} \]
                10. Add Preprocessing

                Alternative 14: 51.1% accurate, 2.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.25:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= B 1.25)
                   (+
                    (/
                     (-
                      (*
                       (fma
                        (fma
                         x
                         0.022222222222222223
                         (*
                          (fma
                           (* x 0.022222222222222223)
                           -0.3333333333333333
                           (* x 0.009523809523809525))
                          (* B B)))
                        (* B B)
                        (* 0.3333333333333333 x))
                       (* B B))
                      x)
                     B)
                    (/
                     (*
                      (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
                      (fma (* 0.16666666666666666 F) (* B B) F))
                     B))
                   (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (B <= 1.25) {
                		tmp = (((fma(fma(x, 0.022222222222222223, (fma((x * 0.022222222222222223), -0.3333333333333333, (x * 0.009523809523809525)) * (B * B))), (B * B), (0.3333333333333333 * x)) * (B * B)) - x) / B) + ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma((0.16666666666666666 * F), (B * B), F)) / B);
                	} else {
                		tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	tmp = 0.0
                	if (B <= 1.25)
                		tmp = Float64(Float64(Float64(Float64(fma(fma(x, 0.022222222222222223, Float64(fma(Float64(x * 0.022222222222222223), -0.3333333333333333, Float64(x * 0.009523809523809525)) * Float64(B * B))), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B)) - x) / B) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B));
                	else
                		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B)));
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := If[LessEqual[B, 1.25], N[(N[(N[(N[(N[(N[(x * 0.022222222222222223 + N[(N[(N[(x * 0.022222222222222223), $MachinePrecision] * -0.3333333333333333 + N[(x * 0.009523809523809525), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;B \leq 1.25:\\
                \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if B < 1.25

                  1. Initial program 79.6%

                    \[\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)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in B around 0

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)}}{B} \]
                    2. *-commutativeN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}}}{B} \]
                    3. associate-*l*N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left({B}^{2} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)} \cdot \frac{1}{6}}{B} \]
                    4. associate-*r*N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{{B}^{2} \cdot \left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}\right)}}{B} \]
                    5. *-commutativeN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}}{B} \]
                    6. lower-/.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
                  5. Applied rewrites64.9%

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}} \]
                  6. Taylor expanded in B around 0

                    \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                  7. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(\frac{-1}{9} \cdot x + \left(\frac{2}{15} \cdot x + {B}^{2} \cdot \left(\frac{-1}{3} \cdot \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right) + \left(\frac{-2}{45} \cdot x + \frac{17}{315} \cdot x\right)\right)\right)\right)\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                  8. Applied rewrites61.2%

                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B}} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]

                  if 1.25 < B

                  1. Initial program 88.2%

                    \[\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)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                    2. lower-*.f64N/A

                      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
                    3. lower-sqrt.f64N/A

                      \[\leadsto \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
                    4. lower-/.f64N/A

                      \[\leadsto \sqrt{\color{blue}{\frac{1}{2 + {F}^{2}}}} \cdot \frac{F}{\sin B} \]
                    5. +-commutativeN/A

                      \[\leadsto \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}} \cdot \frac{F}{\sin B} \]
                    6. unpow2N/A

                      \[\leadsto \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{F}{\sin B} \]
                    7. lower-fma.f64N/A

                      \[\leadsto \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}} \cdot \frac{F}{\sin B} \]
                    8. lower-/.f64N/A

                      \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                    9. lower-sin.f6432.2

                      \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                  5. Applied rewrites32.2%

                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}} \]
                3. Recombined 2 regimes into one program.
                4. Final simplification54.4%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.25:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.022222222222222223, \mathsf{fma}\left(x \cdot 0.022222222222222223, -0.3333333333333333, x \cdot 0.009523809523809525\right) \cdot \left(B \cdot B\right)\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\ \end{array} \]
                5. Add Preprocessing

                Alternative 15: 58.7% accurate, 3.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{1 + x}{-\sin B}\\ \mathbf{elif}\;F \leq 185000000:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -9e-5)
                   (/ (+ 1.0 x) (- (sin B)))
                   (if (<= F 185000000.0)
                     (+
                      (- (/ x B))
                      (/
                       (*
                        (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
                        (fma (* 0.16666666666666666 F) (* B B) F))
                       B))
                     (/ (- 1.0 x) B))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -9e-5) {
                		tmp = (1.0 + x) / -sin(B);
                	} else if (F <= 185000000.0) {
                		tmp = -(x / B) + ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma((0.16666666666666666 * F), (B * B), F)) / B);
                	} else {
                		tmp = (1.0 - x) / B;
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -9e-5)
                		tmp = Float64(Float64(1.0 + x) / Float64(-sin(B)));
                	elseif (F <= 185000000.0)
                		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B));
                	else
                		tmp = Float64(Float64(1.0 - x) / B);
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[(N[(1.0 + x), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 185000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
                \;\;\;\;\frac{1 + x}{-\sin B}\\
                
                \mathbf{elif}\;F \leq 185000000:\\
                \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1 - x}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -9.00000000000000057e-5

                  1. Initial program 72.3%

                    \[\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)} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                    2. lift-/.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    3. associate-*l/N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
                    4. lower-/.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \]
                    5. *-commutativeN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
                    6. lower-*.f6480.4

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot F}}{\sin B} \]
                    7. lift-+.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                    8. +-commutativeN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                    9. lift-*.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                    10. lower-fma.f6480.4

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                    11. lift-+.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F + 2}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                    12. lift-*.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{F \cdot F} + 2\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                    13. lower-fma.f6480.4

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)} \cdot F}{\sin B} \]
                    14. lift-neg.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \cdot F}{\sin B} \]
                    15. lift-/.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
                    16. metadata-evalN/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \cdot F}{\sin B} \]
                    17. metadata-eval80.4

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}} \cdot F}{\sin B} \]
                  4. Applied rewrites80.4%

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B}} \]
                  5. Taylor expanded in F around -inf

                    \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                  6. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \color{blue}{\mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right)} \]
                    2. lower-neg.f64N/A

                      \[\leadsto \color{blue}{-\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                    3. +-commutativeN/A

                      \[\leadsto -\color{blue}{\left(\frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}\right)} \]
                    4. div-add-revN/A

                      \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
                    5. lower-/.f64N/A

                      \[\leadsto -\color{blue}{\frac{x \cdot \cos B + 1}{\sin B}} \]
                    6. *-commutativeN/A

                      \[\leadsto -\frac{\color{blue}{\cos B \cdot x} + 1}{\sin B} \]
                    7. lower-fma.f64N/A

                      \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(\cos B, x, 1\right)}}{\sin B} \]
                    8. lower-cos.f64N/A

                      \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\cos B}, x, 1\right)}{\sin B} \]
                    9. lower-sin.f6497.5

                      \[\leadsto -\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\color{blue}{\sin B}} \]
                  7. Applied rewrites97.5%

                    \[\leadsto \color{blue}{-\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}} \]
                  8. Taylor expanded in B around 0

                    \[\leadsto -\frac{1 + x}{\sin B} \]
                  9. Step-by-step derivation
                    1. Applied rewrites75.4%

                      \[\leadsto -\frac{1 + x}{\sin B} \]

                    if -9.00000000000000057e-5 < F < 1.85e8

                    1. Initial program 99.4%

                      \[\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)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in B around 0

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)}}{B} \]
                      2. *-commutativeN/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}}}{B} \]
                      3. associate-*l*N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left({B}^{2} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)} \cdot \frac{1}{6}}{B} \]
                      4. associate-*r*N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{{B}^{2} \cdot \left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}\right)}}{B} \]
                      5. *-commutativeN/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}}{B} \]
                      6. lower-/.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
                    5. Applied rewrites65.4%

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}} \]
                    6. Taylor expanded in B around 0

                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                    7. Step-by-step derivation
                      1. lower-/.f6458.3

                        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]
                    8. Applied rewrites58.3%

                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]

                    if 1.85e8 < F

                    1. Initial program 64.8%

                      \[\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)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in B around 0

                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                      2. lower--.f64N/A

                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                      3. *-commutativeN/A

                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                      4. lower-*.f64N/A

                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                      5. lower-sqrt.f64N/A

                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                      6. lower-/.f64N/A

                        \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                      7. associate-+r+N/A

                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                      8. +-commutativeN/A

                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                      9. unpow2N/A

                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                      10. lower-fma.f64N/A

                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                      11. +-commutativeN/A

                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                      12. lower-fma.f6439.3

                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                    5. Applied rewrites39.3%

                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                    6. Taylor expanded in F around inf

                      \[\leadsto \frac{1 - x}{B} \]
                    7. Step-by-step derivation
                      1. Applied rewrites52.6%

                        \[\leadsto \frac{1 - x}{B} \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification61.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{1 + x}{-\sin B}\\ \mathbf{elif}\;F \leq 185000000:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 16: 51.2% accurate, 3.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 185000000:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -9e-5)
                       (/ (- (- (* (/ 0.5 F) (/ (fma 2.0 x 2.0) F)) 1.0) x) B)
                       (if (<= F 185000000.0)
                         (+
                          (- (/ x B))
                          (/
                           (*
                            (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
                            (fma (* 0.16666666666666666 F) (* B B) F))
                           B))
                         (/ (- 1.0 x) B))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -9e-5) {
                    		tmp = ((((0.5 / F) * (fma(2.0, x, 2.0) / F)) - 1.0) - x) / B;
                    	} else if (F <= 185000000.0) {
                    		tmp = -(x / B) + ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma((0.16666666666666666 * F), (B * B), F)) / B);
                    	} else {
                    		tmp = (1.0 - x) / B;
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -9e-5)
                    		tmp = Float64(Float64(Float64(Float64(Float64(0.5 / F) * Float64(fma(2.0, x, 2.0) / F)) - 1.0) - x) / B);
                    	elseif (F <= 185000000.0)
                    		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B));
                    	else
                    		tmp = Float64(Float64(1.0 - x) / B);
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[(N[(N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 185000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
                    \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\
                    
                    \mathbf{elif}\;F \leq 185000000:\\
                    \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1 - x}{B}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -9.00000000000000057e-5

                      1. Initial program 72.3%

                        \[\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)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in B around 0

                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        2. lower--.f64N/A

                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                        3. *-commutativeN/A

                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                        4. lower-*.f64N/A

                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                        5. lower-sqrt.f64N/A

                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                        6. lower-/.f64N/A

                          \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                        7. associate-+r+N/A

                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                        8. +-commutativeN/A

                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                        9. unpow2N/A

                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                        10. lower-fma.f64N/A

                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                        11. +-commutativeN/A

                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                        12. lower-fma.f6441.8

                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                      5. Applied rewrites41.8%

                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                      6. Taylor expanded in F around -inf

                        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                      7. Step-by-step derivation
                        1. Applied rewrites52.2%

                          \[\leadsto \frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B} \]

                        if -9.00000000000000057e-5 < F < 1.85e8

                        1. Initial program 99.4%

                          \[\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)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in B around 0

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}{B}} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \frac{1}{6} \cdot \left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)}}{B} \]
                          2. *-commutativeN/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left(\left({B}^{2} \cdot F\right) \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}}}{B} \]
                          3. associate-*l*N/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{\left({B}^{2} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)} \cdot \frac{1}{6}}{B} \]
                          4. associate-*r*N/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \color{blue}{{B}^{2} \cdot \left(\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) \cdot \frac{1}{6}\right)}}{B} \]
                          5. *-commutativeN/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \color{blue}{\left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}}{B} \]
                          6. lower-/.f64N/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right)\right)}{B}} \]
                        5. Applied rewrites65.4%

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}} \]
                        6. Taylor expanded in B around 0

                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\frac{1}{6} \cdot F, B \cdot B, F\right)}{B} \]
                        7. Step-by-step derivation
                          1. lower-/.f6458.3

                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]
                        8. Applied rewrites58.3%

                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B} \]

                        if 1.85e8 < F

                        1. Initial program 64.8%

                          \[\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)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in B around 0

                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                          2. lower--.f64N/A

                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                          3. *-commutativeN/A

                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                          4. lower-*.f64N/A

                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                          5. lower-sqrt.f64N/A

                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                          6. lower-/.f64N/A

                            \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                          7. associate-+r+N/A

                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                          8. +-commutativeN/A

                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                          9. unpow2N/A

                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                          10. lower-fma.f64N/A

                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                          11. +-commutativeN/A

                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                          12. lower-fma.f6439.3

                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                        5. Applied rewrites39.3%

                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                        6. Taylor expanded in F around inf

                          \[\leadsto \frac{1 - x}{B} \]
                        7. Step-by-step derivation
                          1. Applied rewrites52.6%

                            \[\leadsto \frac{1 - x}{B} \]
                        8. Recombined 3 regimes into one program.
                        9. Final simplification54.9%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 185000000:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 17: 44.6% accurate, 5.4× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\ \mathbf{if}\;F \leq -1350000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 10800:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (let* ((t_0 (/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) B)))
                           (if (<= F -1350000.0)
                             (/ (- -1.0 x) B)
                             (if (<= F -3.5e-35)
                               t_0
                               (if (<= F 1.5e-152)
                                 (/ (- x) B)
                                 (if (<= F 10800.0) t_0 (/ (- 1.0 x) B)))))))
                        double code(double F, double B, double x) {
                        	double t_0 = (sqrt((1.0 / fma(F, F, 2.0))) * F) / B;
                        	double tmp;
                        	if (F <= -1350000.0) {
                        		tmp = (-1.0 - x) / B;
                        	} else if (F <= -3.5e-35) {
                        		tmp = t_0;
                        	} else if (F <= 1.5e-152) {
                        		tmp = -x / B;
                        	} else if (F <= 10800.0) {
                        		tmp = t_0;
                        	} else {
                        		tmp = (1.0 - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        function code(F, B, x)
                        	t_0 = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / B)
                        	tmp = 0.0
                        	if (F <= -1350000.0)
                        		tmp = Float64(Float64(-1.0 - x) / B);
                        	elseif (F <= -3.5e-35)
                        		tmp = t_0;
                        	elseif (F <= 1.5e-152)
                        		tmp = Float64(Float64(-x) / B);
                        	elseif (F <= 10800.0)
                        		tmp = t_0;
                        	else
                        		tmp = Float64(Float64(1.0 - x) / B);
                        	end
                        	return tmp
                        end
                        
                        code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -1350000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3.5e-35], t$95$0, If[LessEqual[F, 1.5e-152], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 10800.0], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\
                        \mathbf{if}\;F \leq -1350000:\\
                        \;\;\;\;\frac{-1 - x}{B}\\
                        
                        \mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\
                        \;\;\;\;\frac{-x}{B}\\
                        
                        \mathbf{elif}\;F \leq 10800:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{1 - x}{B}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if F < -1.35e6

                          1. Initial program 70.8%

                            \[\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)} \]
                          2. Add Preprocessing
                          3. Taylor expanded in B around 0

                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            2. lower--.f64N/A

                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                            3. *-commutativeN/A

                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                            4. lower-*.f64N/A

                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                            5. lower-sqrt.f64N/A

                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                            6. lower-/.f64N/A

                              \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                            7. associate-+r+N/A

                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                            8. +-commutativeN/A

                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                            9. unpow2N/A

                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                            10. lower-fma.f64N/A

                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                            11. +-commutativeN/A

                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                            12. lower-fma.f6442.7

                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                          5. Applied rewrites42.7%

                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                          6. Taylor expanded in F around -inf

                            \[\leadsto \frac{-1 - x}{B} \]
                          7. Step-by-step derivation
                            1. Applied rewrites53.6%

                              \[\leadsto \frac{-1 - x}{B} \]

                            if -1.35e6 < F < -3.49999999999999996e-35 or 1.5e-152 < F < 10800

                            1. Initial program 99.3%

                              \[\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)} \]
                            2. Add Preprocessing
                            3. Taylor expanded in B around 0

                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              2. lower--.f64N/A

                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                              3. *-commutativeN/A

                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                              4. lower-*.f64N/A

                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                              5. lower-sqrt.f64N/A

                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                              6. lower-/.f64N/A

                                \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                              7. associate-+r+N/A

                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                              8. +-commutativeN/A

                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                              9. unpow2N/A

                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                              10. lower-fma.f64N/A

                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                              11. +-commutativeN/A

                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                              12. lower-fma.f6452.0

                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                            5. Applied rewrites52.0%

                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                            6. Taylor expanded in x around 0

                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B} \]
                            7. Step-by-step derivation
                              1. Applied rewrites43.5%

                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B} \]

                              if -3.49999999999999996e-35 < F < 1.5e-152

                              1. Initial program 99.5%

                                \[\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)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in B around 0

                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              4. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                2. lower--.f64N/A

                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                3. *-commutativeN/A

                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                4. lower-*.f64N/A

                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                5. lower-sqrt.f64N/A

                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                6. lower-/.f64N/A

                                  \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                7. associate-+r+N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                9. unpow2N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                10. lower-fma.f64N/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                11. +-commutativeN/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                12. lower-fma.f6459.1

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                              5. Applied rewrites59.1%

                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                              6. Taylor expanded in F around 0

                                \[\leadsto \frac{-1 \cdot x}{B} \]
                              7. Step-by-step derivation
                                1. Applied rewrites47.7%

                                  \[\leadsto \frac{-x}{B} \]

                                if 10800 < F

                                1. Initial program 64.8%

                                  \[\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)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in B around 0

                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                  2. lower--.f64N/A

                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                  3. *-commutativeN/A

                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                  4. lower-*.f64N/A

                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                  5. lower-sqrt.f64N/A

                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                  6. lower-/.f64N/A

                                    \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                  7. associate-+r+N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                  8. +-commutativeN/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                  9. unpow2N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                  10. lower-fma.f64N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                  11. +-commutativeN/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                  12. lower-fma.f6439.3

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                5. Applied rewrites39.3%

                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                6. Taylor expanded in F around inf

                                  \[\leadsto \frac{1 - x}{B} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites52.6%

                                    \[\leadsto \frac{1 - x}{B} \]
                                8. Recombined 4 regimes into one program.
                                9. Final simplification50.2%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1350000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 10800:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                10. Add Preprocessing

                                Alternative 18: 44.6% accurate, 5.4× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\ \mathbf{if}\;F \leq -1350000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 10800:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (let* ((t_0 (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F B))))
                                   (if (<= F -1350000.0)
                                     (/ (- -1.0 x) B)
                                     (if (<= F -3.5e-35)
                                       t_0
                                       (if (<= F 1.5e-152)
                                         (/ (- x) B)
                                         (if (<= F 10800.0) t_0 (/ (- 1.0 x) B)))))))
                                double code(double F, double B, double x) {
                                	double t_0 = sqrt((1.0 / fma(F, F, 2.0))) * (F / B);
                                	double tmp;
                                	if (F <= -1350000.0) {
                                		tmp = (-1.0 - x) / B;
                                	} else if (F <= -3.5e-35) {
                                		tmp = t_0;
                                	} else if (F <= 1.5e-152) {
                                		tmp = -x / B;
                                	} else if (F <= 10800.0) {
                                		tmp = t_0;
                                	} else {
                                		tmp = (1.0 - x) / B;
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	t_0 = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / B))
                                	tmp = 0.0
                                	if (F <= -1350000.0)
                                		tmp = Float64(Float64(-1.0 - x) / B);
                                	elseif (F <= -3.5e-35)
                                		tmp = t_0;
                                	elseif (F <= 1.5e-152)
                                		tmp = Float64(Float64(-x) / B);
                                	elseif (F <= 10800.0)
                                		tmp = t_0;
                                	else
                                		tmp = Float64(Float64(1.0 - x) / B);
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1350000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3.5e-35], t$95$0, If[LessEqual[F, 1.5e-152], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 10800.0], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\
                                \mathbf{if}\;F \leq -1350000:\\
                                \;\;\;\;\frac{-1 - x}{B}\\
                                
                                \mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\
                                \;\;\;\;\frac{-x}{B}\\
                                
                                \mathbf{elif}\;F \leq 10800:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1 - x}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if F < -1.35e6

                                  1. Initial program 70.8%

                                    \[\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)} \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                  4. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    2. lower--.f64N/A

                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                    3. *-commutativeN/A

                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                    4. lower-*.f64N/A

                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                    5. lower-sqrt.f64N/A

                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                    6. lower-/.f64N/A

                                      \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                    7. associate-+r+N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                    8. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                    9. unpow2N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                    10. lower-fma.f64N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                    11. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                    12. lower-fma.f6442.7

                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                  5. Applied rewrites42.7%

                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                  6. Taylor expanded in F around -inf

                                    \[\leadsto \frac{-1 - x}{B} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites53.6%

                                      \[\leadsto \frac{-1 - x}{B} \]

                                    if -1.35e6 < F < -3.49999999999999996e-35 or 1.5e-152 < F < 10800

                                    1. Initial program 99.3%

                                      \[\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)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in B around 0

                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                      2. lower--.f64N/A

                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                      3. *-commutativeN/A

                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                      4. lower-*.f64N/A

                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                      5. lower-sqrt.f64N/A

                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                      6. lower-/.f64N/A

                                        \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                      7. associate-+r+N/A

                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                      8. +-commutativeN/A

                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                      9. unpow2N/A

                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                      10. lower-fma.f64N/A

                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                      11. +-commutativeN/A

                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                      12. lower-fma.f6452.0

                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                    5. Applied rewrites52.0%

                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                    6. Taylor expanded in x around 0

                                      \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites43.4%

                                        \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \color{blue}{\frac{F}{B}} \]

                                      if -3.49999999999999996e-35 < F < 1.5e-152

                                      1. Initial program 99.5%

                                        \[\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)} \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in B around 0

                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                      4. Step-by-step derivation
                                        1. lower-/.f64N/A

                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                        2. lower--.f64N/A

                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                        3. *-commutativeN/A

                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                        4. lower-*.f64N/A

                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                        5. lower-sqrt.f64N/A

                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                        6. lower-/.f64N/A

                                          \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                        7. associate-+r+N/A

                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                        8. +-commutativeN/A

                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                        9. unpow2N/A

                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                        10. lower-fma.f64N/A

                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                        11. +-commutativeN/A

                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                        12. lower-fma.f6459.1

                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                      5. Applied rewrites59.1%

                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                      6. Taylor expanded in F around 0

                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites47.7%

                                          \[\leadsto \frac{-x}{B} \]

                                        if 10800 < F

                                        1. Initial program 64.8%

                                          \[\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)} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in B around 0

                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                        4. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                          2. lower--.f64N/A

                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                          3. *-commutativeN/A

                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                          4. lower-*.f64N/A

                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                          5. lower-sqrt.f64N/A

                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                          6. lower-/.f64N/A

                                            \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                          7. associate-+r+N/A

                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                          8. +-commutativeN/A

                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                          9. unpow2N/A

                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                          10. lower-fma.f64N/A

                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                          11. +-commutativeN/A

                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                          12. lower-fma.f6439.3

                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                        5. Applied rewrites39.3%

                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                        6. Taylor expanded in F around inf

                                          \[\leadsto \frac{1 - x}{B} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites52.6%

                                            \[\leadsto \frac{1 - x}{B} \]
                                        8. Recombined 4 regimes into one program.
                                        9. Final simplification50.2%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1350000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-35}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-152}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 10800:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                        10. Add Preprocessing

                                        Alternative 19: 51.3% accurate, 5.7× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 10000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (if (<= F -9e-5)
                                           (/ (- (- (* (/ 0.5 F) (/ (fma 2.0 x 2.0) F)) 1.0) x) B)
                                           (if (<= F 10000.0)
                                             (/ (- (* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F) x) B)
                                             (/ (- 1.0 x) B))))
                                        double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -9e-5) {
                                        		tmp = ((((0.5 / F) * (fma(2.0, x, 2.0) / F)) - 1.0) - x) / B;
                                        	} else if (F <= 10000.0) {
                                        		tmp = ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
                                        	} else {
                                        		tmp = (1.0 - x) / B;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(F, B, x)
                                        	tmp = 0.0
                                        	if (F <= -9e-5)
                                        		tmp = Float64(Float64(Float64(Float64(Float64(0.5 / F) * Float64(fma(2.0, x, 2.0) / F)) - 1.0) - x) / B);
                                        	elseif (F <= 10000.0)
                                        		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B);
                                        	else
                                        		tmp = Float64(Float64(1.0 - x) / B);
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[F_, B_, x_] := If[LessEqual[F, -9e-5], N[(N[(N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 10000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
                                        \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\
                                        
                                        \mathbf{elif}\;F \leq 10000:\\
                                        \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{1 - x}{B}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if F < -9.00000000000000057e-5

                                          1. Initial program 72.3%

                                            \[\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)} \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in B around 0

                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                          4. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            2. lower--.f64N/A

                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                            3. *-commutativeN/A

                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                            4. lower-*.f64N/A

                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                            5. lower-sqrt.f64N/A

                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                            6. lower-/.f64N/A

                                              \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                            7. associate-+r+N/A

                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                            8. +-commutativeN/A

                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                            9. unpow2N/A

                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                            10. lower-fma.f64N/A

                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                            11. +-commutativeN/A

                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                            12. lower-fma.f6441.8

                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                          5. Applied rewrites41.8%

                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                          6. Taylor expanded in F around -inf

                                            \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites52.2%

                                              \[\leadsto \frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B} \]

                                            if -9.00000000000000057e-5 < F < 1e4

                                            1. Initial program 99.4%

                                              \[\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)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            4. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              2. lower--.f64N/A

                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                              3. *-commutativeN/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                              4. lower-*.f64N/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                              5. lower-sqrt.f64N/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                              6. lower-/.f64N/A

                                                \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                              7. associate-+r+N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                              8. +-commutativeN/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                              9. unpow2N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                              10. lower-fma.f64N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                              11. +-commutativeN/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                              12. lower-fma.f6458.0

                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                            5. Applied rewrites58.0%

                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]

                                            if 1e4 < F

                                            1. Initial program 64.8%

                                              \[\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)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            4. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              2. lower--.f64N/A

                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                              3. *-commutativeN/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                              4. lower-*.f64N/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                              5. lower-sqrt.f64N/A

                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                              6. lower-/.f64N/A

                                                \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                              7. associate-+r+N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                              8. +-commutativeN/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                              9. unpow2N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                              10. lower-fma.f64N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                              11. +-commutativeN/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                              12. lower-fma.f6439.3

                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                            5. Applied rewrites39.3%

                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                            6. Taylor expanded in F around inf

                                              \[\leadsto \frac{1 - x}{B} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites52.6%

                                                \[\leadsto \frac{1 - x}{B} \]
                                            8. Recombined 3 regimes into one program.
                                            9. Final simplification54.8%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 10000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                            10. Add Preprocessing

                                            Alternative 20: 51.1% accurate, 6.0× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(2, x, 2\right)}{F}\\ \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot t\_0 - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, t\_0, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (let* ((t_0 (/ (fma 2.0 x 2.0) F)))
                                               (if (<= F -9e-5)
                                                 (/ (- (- (* (/ 0.5 F) t_0) 1.0) x) B)
                                                 (if (<= F 2.3e-9)
                                                   (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                                                   (/ (- (fma (/ -0.5 F) t_0 1.0) x) B)))))
                                            double code(double F, double B, double x) {
                                            	double t_0 = fma(2.0, x, 2.0) / F;
                                            	double tmp;
                                            	if (F <= -9e-5) {
                                            		tmp = ((((0.5 / F) * t_0) - 1.0) - x) / B;
                                            	} else if (F <= 2.3e-9) {
                                            		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                                            	} else {
                                            		tmp = (fma((-0.5 / F), t_0, 1.0) - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	t_0 = Float64(fma(2.0, x, 2.0) / F)
                                            	tmp = 0.0
                                            	if (F <= -9e-5)
                                            		tmp = Float64(Float64(Float64(Float64(Float64(0.5 / F) * t_0) - 1.0) - x) / B);
                                            	elseif (F <= 2.3e-9)
                                            		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B);
                                            	else
                                            		tmp = Float64(Float64(fma(Float64(-0.5 / F), t_0, 1.0) - x) / B);
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := Block[{t$95$0 = N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision]}, If[LessEqual[F, -9e-5], N[(N[(N[(N[(N[(0.5 / F), $MachinePrecision] * t$95$0), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * t$95$0 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := \frac{\mathsf{fma}\left(2, x, 2\right)}{F}\\
                                            \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\
                                            \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot t\_0 - 1\right) - x}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
                                            \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, t\_0, 1\right) - x}{B}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -9.00000000000000057e-5

                                              1. Initial program 72.3%

                                                \[\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)} \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in B around 0

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              4. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                2. lower--.f64N/A

                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                3. *-commutativeN/A

                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                5. lower-sqrt.f64N/A

                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                6. lower-/.f64N/A

                                                  \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                7. associate-+r+N/A

                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                8. +-commutativeN/A

                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                9. unpow2N/A

                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                10. lower-fma.f64N/A

                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                11. +-commutativeN/A

                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                12. lower-fma.f6441.8

                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                              5. Applied rewrites41.8%

                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                              6. Taylor expanded in F around -inf

                                                \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites52.2%

                                                  \[\leadsto \frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B} \]

                                                if -9.00000000000000057e-5 < F < 2.2999999999999999e-9

                                                1. Initial program 99.4%

                                                  \[\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)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                4. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  2. lower--.f64N/A

                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                  3. *-commutativeN/A

                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                  4. lower-*.f64N/A

                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                  5. lower-sqrt.f64N/A

                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                  7. associate-+r+N/A

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                  8. +-commutativeN/A

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                  9. unpow2N/A

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                  10. lower-fma.f64N/A

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                  11. +-commutativeN/A

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                  12. lower-fma.f6458.6

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                5. Applied rewrites58.6%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                6. Taylor expanded in F around 0

                                                  \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites58.3%

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]

                                                  if 2.2999999999999999e-9 < F

                                                  1. Initial program 66.1%

                                                    \[\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)} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    2. lower--.f64N/A

                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                    3. *-commutativeN/A

                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                    4. lower-*.f64N/A

                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                    5. lower-sqrt.f64N/A

                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                    6. lower-/.f64N/A

                                                      \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                    7. associate-+r+N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                    8. +-commutativeN/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                    9. unpow2N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                    10. lower-fma.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                    11. +-commutativeN/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                    12. lower-fma.f6439.3

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                  5. Applied rewrites39.3%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                  6. Taylor expanded in F around inf

                                                    \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites52.0%

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B} \]
                                                  8. Recombined 3 regimes into one program.
                                                  9. Final simplification54.7%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-5}:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \]
                                                  10. Add Preprocessing

                                                  Alternative 21: 51.2% accurate, 6.0× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.9:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                                  (FPCore (F B x)
                                                   :precision binary64
                                                   (if (<= F -1.9)
                                                     (/ (- -1.0 x) B)
                                                     (if (<= F 2.3e-9)
                                                       (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                                                       (/ (- (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) 1.0) x) B))))
                                                  double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (F <= -1.9) {
                                                  		tmp = (-1.0 - x) / B;
                                                  	} else if (F <= 2.3e-9) {
                                                  		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                                                  	} else {
                                                  		tmp = (fma((-0.5 / F), (fma(2.0, x, 2.0) / F), 1.0) - x) / B;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(F, B, x)
                                                  	tmp = 0.0
                                                  	if (F <= -1.9)
                                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                                  	elseif (F <= 2.3e-9)
                                                  		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B);
                                                  	else
                                                  		tmp = Float64(Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), 1.0) - x) / B);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[F_, B_, x_] := If[LessEqual[F, -1.9], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;F \leq -1.9:\\
                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                  
                                                  \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
                                                  \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if F < -1.8999999999999999

                                                    1. Initial program 71.9%

                                                      \[\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)} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    4. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                      2. lower--.f64N/A

                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                      3. *-commutativeN/A

                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                      4. lower-*.f64N/A

                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                      5. lower-sqrt.f64N/A

                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                      6. lower-/.f64N/A

                                                        \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                      7. associate-+r+N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                      8. +-commutativeN/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                      9. unpow2N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                      10. lower-fma.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                      11. +-commutativeN/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                      12. lower-fma.f6442.3

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                    5. Applied rewrites42.3%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                    6. Taylor expanded in F around -inf

                                                      \[\leadsto \frac{-1 - x}{B} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites52.6%

                                                        \[\leadsto \frac{-1 - x}{B} \]

                                                      if -1.8999999999999999 < F < 2.2999999999999999e-9

                                                      1. Initial program 99.4%

                                                        \[\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)} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in B around 0

                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                      4. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        2. lower--.f64N/A

                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                        3. *-commutativeN/A

                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                        4. lower-*.f64N/A

                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                        5. lower-sqrt.f64N/A

                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                        6. lower-/.f64N/A

                                                          \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                        7. associate-+r+N/A

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                        8. +-commutativeN/A

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                        9. unpow2N/A

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                        10. lower-fma.f64N/A

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                        11. +-commutativeN/A

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                        12. lower-fma.f6458.0

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                      5. Applied rewrites58.0%

                                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                      6. Taylor expanded in F around 0

                                                        \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites57.8%

                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]

                                                        if 2.2999999999999999e-9 < F

                                                        1. Initial program 66.1%

                                                          \[\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)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in B around 0

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-/.f64N/A

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          2. lower--.f64N/A

                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                          3. *-commutativeN/A

                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                          4. lower-*.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                          5. lower-sqrt.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                          6. lower-/.f64N/A

                                                            \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                          7. associate-+r+N/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                          8. +-commutativeN/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                          9. unpow2N/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                          10. lower-fma.f64N/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                          11. +-commutativeN/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                          12. lower-fma.f6439.3

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                        5. Applied rewrites39.3%

                                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                        6. Taylor expanded in F around inf

                                                          \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites52.0%

                                                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B} \]
                                                        8. Recombined 3 regimes into one program.
                                                        9. Final simplification54.6%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \]
                                                        10. Add Preprocessing

                                                        Alternative 22: 51.2% accurate, 6.2× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.9:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                        (FPCore (F B x)
                                                         :precision binary64
                                                         (if (<= F -1.9)
                                                           (/ (- -1.0 x) B)
                                                           (if (<= F 2.3e-9)
                                                             (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                                                             (/ (- 1.0 x) B))))
                                                        double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -1.9) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else if (F <= 2.3e-9) {
                                                        		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                                                        	} else {
                                                        		tmp = (1.0 - x) / B;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(F, B, x)
                                                        	tmp = 0.0
                                                        	if (F <= -1.9)
                                                        		tmp = Float64(Float64(-1.0 - x) / B);
                                                        	elseif (F <= 2.3e-9)
                                                        		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B);
                                                        	else
                                                        		tmp = Float64(Float64(1.0 - x) / B);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[F_, B_, x_] := If[LessEqual[F, -1.9], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;F \leq -1.9:\\
                                                        \;\;\;\;\frac{-1 - x}{B}\\
                                                        
                                                        \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
                                                        \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\frac{1 - x}{B}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 3 regimes
                                                        2. if F < -1.8999999999999999

                                                          1. Initial program 71.9%

                                                            \[\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)} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in B around 0

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            2. lower--.f64N/A

                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                            3. *-commutativeN/A

                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                            4. lower-*.f64N/A

                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                            5. lower-sqrt.f64N/A

                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                            6. lower-/.f64N/A

                                                              \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                            7. associate-+r+N/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                            8. +-commutativeN/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                            9. unpow2N/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                            10. lower-fma.f64N/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                            11. +-commutativeN/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                            12. lower-fma.f6442.3

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                          5. Applied rewrites42.3%

                                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                          6. Taylor expanded in F around -inf

                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites52.6%

                                                              \[\leadsto \frac{-1 - x}{B} \]

                                                            if -1.8999999999999999 < F < 2.2999999999999999e-9

                                                            1. Initial program 99.4%

                                                              \[\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)} \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in B around 0

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            4. Step-by-step derivation
                                                              1. lower-/.f64N/A

                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                              2. lower--.f64N/A

                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                              3. *-commutativeN/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                              4. lower-*.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                              5. lower-sqrt.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                              6. lower-/.f64N/A

                                                                \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                              7. associate-+r+N/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                              8. +-commutativeN/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                              9. unpow2N/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                              10. lower-fma.f64N/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                              11. +-commutativeN/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                              12. lower-fma.f6458.0

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                            5. Applied rewrites58.0%

                                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                            6. Taylor expanded in F around 0

                                                              \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites57.8%

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]

                                                              if 2.2999999999999999e-9 < F

                                                              1. Initial program 66.1%

                                                                \[\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)} \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in B around 0

                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                              4. Step-by-step derivation
                                                                1. lower-/.f64N/A

                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                2. lower--.f64N/A

                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                3. *-commutativeN/A

                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                4. lower-*.f64N/A

                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                5. lower-sqrt.f64N/A

                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                6. lower-/.f64N/A

                                                                  \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                7. associate-+r+N/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                8. +-commutativeN/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                9. unpow2N/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                10. lower-fma.f64N/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                11. +-commutativeN/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                12. lower-fma.f6439.3

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                              5. Applied rewrites39.3%

                                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                              6. Taylor expanded in F around inf

                                                                \[\leadsto \frac{1 - x}{B} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites51.5%

                                                                  \[\leadsto \frac{1 - x}{B} \]
                                                              8. Recombined 3 regimes into one program.
                                                              9. Final simplification54.4%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.9:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                              10. Add Preprocessing

                                                              Alternative 23: 43.7% accurate, 8.8× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-59}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-114}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                              (FPCore (F B x)
                                                               :precision binary64
                                                               (if (<= F -1.6e-59)
                                                                 (/ (- -1.0 x) B)
                                                                 (if (<= F 2.1e-114)
                                                                   (/ (- (fma (* -0.3333333333333333 x) (* B B) x)) B)
                                                                   (/ (- 1.0 x) B))))
                                                              double code(double F, double B, double x) {
                                                              	double tmp;
                                                              	if (F <= -1.6e-59) {
                                                              		tmp = (-1.0 - x) / B;
                                                              	} else if (F <= 2.1e-114) {
                                                              		tmp = -fma((-0.3333333333333333 * x), (B * B), x) / B;
                                                              	} else {
                                                              		tmp = (1.0 - x) / B;
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              function code(F, B, x)
                                                              	tmp = 0.0
                                                              	if (F <= -1.6e-59)
                                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                                              	elseif (F <= 2.1e-114)
                                                              		tmp = Float64(Float64(-fma(Float64(-0.3333333333333333 * x), Float64(B * B), x)) / B);
                                                              	else
                                                              		tmp = Float64(Float64(1.0 - x) / B);
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              code[F_, B_, x_] := If[LessEqual[F, -1.6e-59], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.1e-114], N[((-N[(N[(-0.3333333333333333 * x), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision]) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              \mathbf{if}\;F \leq -1.6 \cdot 10^{-59}:\\
                                                              \;\;\;\;\frac{-1 - x}{B}\\
                                                              
                                                              \mathbf{elif}\;F \leq 2.1 \cdot 10^{-114}:\\
                                                              \;\;\;\;\frac{-\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{B}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\frac{1 - x}{B}\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 3 regimes
                                                              2. if F < -1.6e-59

                                                                1. Initial program 75.1%

                                                                  \[\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)} \]
                                                                2. Add Preprocessing
                                                                3. Taylor expanded in B around 0

                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                4. Step-by-step derivation
                                                                  1. lower-/.f64N/A

                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                  2. lower--.f64N/A

                                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                  3. *-commutativeN/A

                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                  4. lower-*.f64N/A

                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                  5. lower-sqrt.f64N/A

                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                  6. lower-/.f64N/A

                                                                    \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                  7. associate-+r+N/A

                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                  8. +-commutativeN/A

                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                  9. unpow2N/A

                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                  10. lower-fma.f64N/A

                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                  11. +-commutativeN/A

                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                  12. lower-fma.f6444.6

                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                5. Applied rewrites44.6%

                                                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                6. Taylor expanded in F around -inf

                                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites48.3%

                                                                    \[\leadsto \frac{-1 - x}{B} \]

                                                                  if -1.6e-59 < F < 2.09999999999999993e-114

                                                                  1. Initial program 99.5%

                                                                    \[\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)} \]
                                                                  2. Add Preprocessing
                                                                  3. Step-by-step derivation
                                                                    1. lift-+.f64N/A

                                                                      \[\leadsto \color{blue}{\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)}} \]
                                                                    2. +-commutativeN/A

                                                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
                                                                    3. lift-*.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    4. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    5. lower-fma.f6499.5

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \frac{F}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                                                                  4. Applied rewrites99.7%

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)} \]
                                                                  5. Taylor expanded in F around 0

                                                                    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                  6. Step-by-step derivation
                                                                    1. mul-1-negN/A

                                                                      \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                    2. associate-/l*N/A

                                                                      \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{\cos B}{\sin B}}\right) \]
                                                                    3. distribute-lft-neg-inN/A

                                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                    4. lower-*.f64N/A

                                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                    5. lower-neg.f64N/A

                                                                      \[\leadsto \color{blue}{\left(-x\right)} \cdot \frac{\cos B}{\sin B} \]
                                                                    6. lower-/.f64N/A

                                                                      \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{\cos B}{\sin B}} \]
                                                                    7. lower-cos.f64N/A

                                                                      \[\leadsto \left(-x\right) \cdot \frac{\color{blue}{\cos B}}{\sin B} \]
                                                                    8. lower-sin.f6471.9

                                                                      \[\leadsto \left(-x\right) \cdot \frac{\cos B}{\color{blue}{\sin B}} \]
                                                                  7. Applied rewrites71.9%

                                                                    \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                  8. Taylor expanded in B around 0

                                                                    \[\leadsto \frac{-1 \cdot x + -1 \cdot \left({B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)\right)}{\color{blue}{B}} \]
                                                                  9. Step-by-step derivation
                                                                    1. Applied rewrites46.2%

                                                                      \[\leadsto \frac{-\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{\color{blue}{B}} \]

                                                                    if 2.09999999999999993e-114 < F

                                                                    1. Initial program 72.3%

                                                                      \[\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)} \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in B around 0

                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                    4. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                      2. lower--.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                      3. *-commutativeN/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                      5. lower-sqrt.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                      6. lower-/.f64N/A

                                                                        \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                      7. associate-+r+N/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                      8. +-commutativeN/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                      9. unpow2N/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                      10. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                      11. +-commutativeN/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                      12. lower-fma.f6441.1

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                    5. Applied rewrites41.1%

                                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                    6. Taylor expanded in F around inf

                                                                      \[\leadsto \frac{1 - x}{B} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites45.2%

                                                                        \[\leadsto \frac{1 - x}{B} \]
                                                                    8. Recombined 3 regimes into one program.
                                                                    9. Final simplification46.5%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-59}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-114}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                                    10. Add Preprocessing

                                                                    Alternative 24: 44.1% accurate, 13.6× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-50}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                    (FPCore (F B x)
                                                                     :precision binary64
                                                                     (if (<= F -1.5e-65)
                                                                       (/ (- -1.0 x) B)
                                                                       (if (<= F 5.6e-50) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                    double code(double F, double B, double x) {
                                                                    	double tmp;
                                                                    	if (F <= -1.5e-65) {
                                                                    		tmp = (-1.0 - x) / B;
                                                                    	} else if (F <= 5.6e-50) {
                                                                    		tmp = -x / B;
                                                                    	} else {
                                                                    		tmp = (1.0 - x) / B;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    module fmin_fmax_functions
                                                                        implicit none
                                                                        private
                                                                        public fmax
                                                                        public fmin
                                                                    
                                                                        interface fmax
                                                                            module procedure fmax88
                                                                            module procedure fmax44
                                                                            module procedure fmax84
                                                                            module procedure fmax48
                                                                        end interface
                                                                        interface fmin
                                                                            module procedure fmin88
                                                                            module procedure fmin44
                                                                            module procedure fmin84
                                                                            module procedure fmin48
                                                                        end interface
                                                                    contains
                                                                        real(8) function fmax88(x, y) result (res)
                                                                            real(8), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(4) function fmax44(x, y) result (res)
                                                                            real(4), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmax84(x, y) result(res)
                                                                            real(8), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmax48(x, y) result(res)
                                                                            real(4), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmin88(x, y) result (res)
                                                                            real(8), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(4) function fmin44(x, y) result (res)
                                                                            real(4), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmin84(x, y) result(res)
                                                                            real(8), intent (in) :: x
                                                                            real(4), intent (in) :: y
                                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                        end function
                                                                        real(8) function fmin48(x, y) result(res)
                                                                            real(4), intent (in) :: x
                                                                            real(8), intent (in) :: y
                                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                        end function
                                                                    end module
                                                                    
                                                                    real(8) function code(f, b, x)
                                                                    use fmin_fmax_functions
                                                                        real(8), intent (in) :: f
                                                                        real(8), intent (in) :: b
                                                                        real(8), intent (in) :: x
                                                                        real(8) :: tmp
                                                                        if (f <= (-1.5d-65)) then
                                                                            tmp = ((-1.0d0) - x) / b
                                                                        else if (f <= 5.6d-50) then
                                                                            tmp = -x / b
                                                                        else
                                                                            tmp = (1.0d0 - x) / b
                                                                        end if
                                                                        code = tmp
                                                                    end function
                                                                    
                                                                    public static double code(double F, double B, double x) {
                                                                    	double tmp;
                                                                    	if (F <= -1.5e-65) {
                                                                    		tmp = (-1.0 - x) / B;
                                                                    	} else if (F <= 5.6e-50) {
                                                                    		tmp = -x / B;
                                                                    	} else {
                                                                    		tmp = (1.0 - x) / B;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    def code(F, B, x):
                                                                    	tmp = 0
                                                                    	if F <= -1.5e-65:
                                                                    		tmp = (-1.0 - x) / B
                                                                    	elif F <= 5.6e-50:
                                                                    		tmp = -x / B
                                                                    	else:
                                                                    		tmp = (1.0 - x) / B
                                                                    	return tmp
                                                                    
                                                                    function code(F, B, x)
                                                                    	tmp = 0.0
                                                                    	if (F <= -1.5e-65)
                                                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                                                    	elseif (F <= 5.6e-50)
                                                                    		tmp = Float64(Float64(-x) / B);
                                                                    	else
                                                                    		tmp = Float64(Float64(1.0 - x) / B);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    function tmp_2 = code(F, B, x)
                                                                    	tmp = 0.0;
                                                                    	if (F <= -1.5e-65)
                                                                    		tmp = (-1.0 - x) / B;
                                                                    	elseif (F <= 5.6e-50)
                                                                    		tmp = -x / B;
                                                                    	else
                                                                    		tmp = (1.0 - x) / B;
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    code[F_, B_, x_] := If[LessEqual[F, -1.5e-65], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.6e-50], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\
                                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                                    
                                                                    \mathbf{elif}\;F \leq 5.6 \cdot 10^{-50}:\\
                                                                    \;\;\;\;\frac{-x}{B}\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;\frac{1 - x}{B}\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 3 regimes
                                                                    2. if F < -1.49999999999999999e-65

                                                                      1. Initial program 75.4%

                                                                        \[\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)} \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in B around 0

                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                      4. Step-by-step derivation
                                                                        1. lower-/.f64N/A

                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                        2. lower--.f64N/A

                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                        3. *-commutativeN/A

                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                        4. lower-*.f64N/A

                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                        5. lower-sqrt.f64N/A

                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                        6. lower-/.f64N/A

                                                                          \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                        7. associate-+r+N/A

                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                        8. +-commutativeN/A

                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                        9. unpow2N/A

                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                        10. lower-fma.f64N/A

                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                        11. +-commutativeN/A

                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                        12. lower-fma.f6444.1

                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                      5. Applied rewrites44.1%

                                                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                      6. Taylor expanded in F around -inf

                                                                        \[\leadsto \frac{-1 - x}{B} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites47.8%

                                                                          \[\leadsto \frac{-1 - x}{B} \]

                                                                        if -1.49999999999999999e-65 < F < 5.5999999999999996e-50

                                                                        1. Initial program 99.5%

                                                                          \[\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)} \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in B around 0

                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                          2. lower--.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                          3. *-commutativeN/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                          4. lower-*.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                          5. lower-sqrt.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                          6. lower-/.f64N/A

                                                                            \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                          7. associate-+r+N/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                          8. +-commutativeN/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                          9. unpow2N/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                          10. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                          11. +-commutativeN/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                          12. lower-fma.f6457.1

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                        5. Applied rewrites57.1%

                                                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                        6. Taylor expanded in F around 0

                                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites43.9%

                                                                            \[\leadsto \frac{-x}{B} \]

                                                                          if 5.5999999999999996e-50 < F

                                                                          1. Initial program 68.9%

                                                                            \[\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)} \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in B around 0

                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                          4. Step-by-step derivation
                                                                            1. lower-/.f64N/A

                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                            2. lower--.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                            3. *-commutativeN/A

                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                            4. lower-*.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                            5. lower-sqrt.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                            6. lower-/.f64N/A

                                                                              \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                            7. associate-+r+N/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                            8. +-commutativeN/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                            9. unpow2N/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                            10. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                            11. +-commutativeN/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                            12. lower-fma.f6442.1

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                          5. Applied rewrites42.1%

                                                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                          6. Taylor expanded in F around inf

                                                                            \[\leadsto \frac{1 - x}{B} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites47.9%

                                                                              \[\leadsto \frac{1 - x}{B} \]
                                                                          8. Recombined 3 regimes into one program.
                                                                          9. Final simplification46.5%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-50}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                                          10. Add Preprocessing

                                                                          Alternative 25: 36.9% accurate, 17.5× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                          (FPCore (F B x)
                                                                           :precision binary64
                                                                           (if (<= F -1.5e-65) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                          double code(double F, double B, double x) {
                                                                          	double tmp;
                                                                          	if (F <= -1.5e-65) {
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	} else {
                                                                          		tmp = -x / B;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          module fmin_fmax_functions
                                                                              implicit none
                                                                              private
                                                                              public fmax
                                                                              public fmin
                                                                          
                                                                              interface fmax
                                                                                  module procedure fmax88
                                                                                  module procedure fmax44
                                                                                  module procedure fmax84
                                                                                  module procedure fmax48
                                                                              end interface
                                                                              interface fmin
                                                                                  module procedure fmin88
                                                                                  module procedure fmin44
                                                                                  module procedure fmin84
                                                                                  module procedure fmin48
                                                                              end interface
                                                                          contains
                                                                              real(8) function fmax88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmax44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmin44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                          end module
                                                                          
                                                                          real(8) function code(f, b, x)
                                                                          use fmin_fmax_functions
                                                                              real(8), intent (in) :: f
                                                                              real(8), intent (in) :: b
                                                                              real(8), intent (in) :: x
                                                                              real(8) :: tmp
                                                                              if (f <= (-1.5d-65)) then
                                                                                  tmp = ((-1.0d0) - x) / b
                                                                              else
                                                                                  tmp = -x / b
                                                                              end if
                                                                              code = tmp
                                                                          end function
                                                                          
                                                                          public static double code(double F, double B, double x) {
                                                                          	double tmp;
                                                                          	if (F <= -1.5e-65) {
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	} else {
                                                                          		tmp = -x / B;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          def code(F, B, x):
                                                                          	tmp = 0
                                                                          	if F <= -1.5e-65:
                                                                          		tmp = (-1.0 - x) / B
                                                                          	else:
                                                                          		tmp = -x / B
                                                                          	return tmp
                                                                          
                                                                          function code(F, B, x)
                                                                          	tmp = 0.0
                                                                          	if (F <= -1.5e-65)
                                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                                          	else
                                                                          		tmp = Float64(Float64(-x) / B);
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          function tmp_2 = code(F, B, x)
                                                                          	tmp = 0.0;
                                                                          	if (F <= -1.5e-65)
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	else
                                                                          		tmp = -x / B;
                                                                          	end
                                                                          	tmp_2 = tmp;
                                                                          end
                                                                          
                                                                          code[F_, B_, x_] := If[LessEqual[F, -1.5e-65], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\
                                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\frac{-x}{B}\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 2 regimes
                                                                          2. if F < -1.49999999999999999e-65

                                                                            1. Initial program 75.4%

                                                                              \[\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)} \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in B around 0

                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                            4. Step-by-step derivation
                                                                              1. lower-/.f64N/A

                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                              2. lower--.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                              3. *-commutativeN/A

                                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                              4. lower-*.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                              5. lower-sqrt.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                              6. lower-/.f64N/A

                                                                                \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                              7. associate-+r+N/A

                                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                              8. +-commutativeN/A

                                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                              9. unpow2N/A

                                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                              10. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                              11. +-commutativeN/A

                                                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                              12. lower-fma.f6444.1

                                                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                            5. Applied rewrites44.1%

                                                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                            6. Taylor expanded in F around -inf

                                                                              \[\leadsto \frac{-1 - x}{B} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites47.8%

                                                                                \[\leadsto \frac{-1 - x}{B} \]

                                                                              if -1.49999999999999999e-65 < F

                                                                              1. Initial program 84.7%

                                                                                \[\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)} \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in B around 0

                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                              4. Step-by-step derivation
                                                                                1. lower-/.f64N/A

                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                2. lower--.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                3. *-commutativeN/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                4. lower-*.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                5. lower-sqrt.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                6. lower-/.f64N/A

                                                                                  \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                7. associate-+r+N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                8. +-commutativeN/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                9. unpow2N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                10. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                12. lower-fma.f6449.8

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                              5. Applied rewrites49.8%

                                                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                              6. Taylor expanded in F around 0

                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites33.3%

                                                                                  \[\leadsto \frac{-x}{B} \]
                                                                              8. Recombined 2 regimes into one program.
                                                                              9. Final simplification38.1%

                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
                                                                              10. Add Preprocessing

                                                                              Alternative 26: 30.0% accurate, 26.3× speedup?

                                                                              \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                                              (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                                              double code(double F, double B, double x) {
                                                                              	return -x / B;
                                                                              }
                                                                              
                                                                              module fmin_fmax_functions
                                                                                  implicit none
                                                                                  private
                                                                                  public fmax
                                                                                  public fmin
                                                                              
                                                                                  interface fmax
                                                                                      module procedure fmax88
                                                                                      module procedure fmax44
                                                                                      module procedure fmax84
                                                                                      module procedure fmax48
                                                                                  end interface
                                                                                  interface fmin
                                                                                      module procedure fmin88
                                                                                      module procedure fmin44
                                                                                      module procedure fmin84
                                                                                      module procedure fmin48
                                                                                  end interface
                                                                              contains
                                                                                  real(8) function fmax88(x, y) result (res)
                                                                                      real(8), intent (in) :: x
                                                                                      real(8), intent (in) :: y
                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                  end function
                                                                                  real(4) function fmax44(x, y) result (res)
                                                                                      real(4), intent (in) :: x
                                                                                      real(4), intent (in) :: y
                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                  end function
                                                                                  real(8) function fmax84(x, y) result(res)
                                                                                      real(8), intent (in) :: x
                                                                                      real(4), intent (in) :: y
                                                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                  end function
                                                                                  real(8) function fmax48(x, y) result(res)
                                                                                      real(4), intent (in) :: x
                                                                                      real(8), intent (in) :: y
                                                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                  end function
                                                                                  real(8) function fmin88(x, y) result (res)
                                                                                      real(8), intent (in) :: x
                                                                                      real(8), intent (in) :: y
                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                  end function
                                                                                  real(4) function fmin44(x, y) result (res)
                                                                                      real(4), intent (in) :: x
                                                                                      real(4), intent (in) :: y
                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                  end function
                                                                                  real(8) function fmin84(x, y) result(res)
                                                                                      real(8), intent (in) :: x
                                                                                      real(4), intent (in) :: y
                                                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                  end function
                                                                                  real(8) function fmin48(x, y) result(res)
                                                                                      real(4), intent (in) :: x
                                                                                      real(8), intent (in) :: y
                                                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                  end function
                                                                              end module
                                                                              
                                                                              real(8) function code(f, b, x)
                                                                              use fmin_fmax_functions
                                                                                  real(8), intent (in) :: f
                                                                                  real(8), intent (in) :: b
                                                                                  real(8), intent (in) :: x
                                                                                  code = -x / b
                                                                              end function
                                                                              
                                                                              public static double code(double F, double B, double x) {
                                                                              	return -x / B;
                                                                              }
                                                                              
                                                                              def code(F, B, x):
                                                                              	return -x / B
                                                                              
                                                                              function code(F, B, x)
                                                                              	return Float64(Float64(-x) / B)
                                                                              end
                                                                              
                                                                              function tmp = code(F, B, x)
                                                                              	tmp = -x / B;
                                                                              end
                                                                              
                                                                              code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \frac{-x}{B}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Initial program 81.6%

                                                                                \[\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)} \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in B around 0

                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                              4. Step-by-step derivation
                                                                                1. lower-/.f64N/A

                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                2. lower--.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                3. *-commutativeN/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                4. lower-*.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                5. lower-sqrt.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                6. lower-/.f64N/A

                                                                                  \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                7. associate-+r+N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                8. +-commutativeN/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                9. unpow2N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                10. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                12. lower-fma.f6447.9

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                              5. Applied rewrites47.9%

                                                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                              6. Taylor expanded in F around 0

                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites29.3%

                                                                                  \[\leadsto \frac{-x}{B} \]
                                                                                2. Final simplification29.3%

                                                                                  \[\leadsto \frac{-x}{B} \]
                                                                                3. Add Preprocessing

                                                                                Reproduce

                                                                                ?
                                                                                herbie shell --seed 2025015 
                                                                                (FPCore (F B x)
                                                                                  :name "VandenBroeck and Keller, Equation (23)"
                                                                                  :precision binary64
                                                                                  (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))