VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.2% → 99.6%
Time: 7.2s
Alternatives: 24
Speedup: 1.4×

Specification

?
\[\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)} \]
(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]
\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)}

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 24 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: 77.2% accurate, 1.0× speedup?

\[\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)} \]
(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]
\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)}

Alternative 1: 99.6% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

    1. Initial program 77.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. 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. 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. 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)} \]
      4. 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}} \]
      5. add-to-fractionN/A

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{-1}{F}}, F, \sin B \cdot \frac{-x}{\tan B}\right)}{\sin B} \]
    5. Step-by-step derivation
      1. lower-/.f6456.1%

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

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

    if -3.9999999999999999e79 < F < 5e3

    1. Initial program 77.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. 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-neg.f64N/A

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
      5. lower--.f6477.2%

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

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

    if 5e3 < F

    1. Initial program 77.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. 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-neg.f64N/A

        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
      5. lower--.f6477.2%

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

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

      \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. Applied rewrites55.0%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
    6. Recombined 3 regimes into one program.
    7. Add Preprocessing

    Alternative 2: 99.6% accurate, 1.0× speedup?

    \[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.45 \cdot 10^{+154}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t\_0\\ \mathbf{elif}\;F \leq 5000:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (let* ((t_0 (/ x (tan B))))
       (if (<= F -2.45e+154)
         (- (* F (/ -1.0 (* F (sin B)))) t_0)
         (if (<= F 5000.0)
           (- (/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B)) t_0)
           (- (/ 1.0 (sin B)) t_0)))))
    double code(double F, double B, double x) {
    	double t_0 = x / tan(B);
    	double tmp;
    	if (F <= -2.45e+154) {
    		tmp = (F * (-1.0 / (F * sin(B)))) - t_0;
    	} else if (F <= 5000.0) {
    		tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - t_0;
    	} else {
    		tmp = (1.0 / sin(B)) - t_0;
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	t_0 = Float64(x / tan(B))
    	tmp = 0.0
    	if (F <= -2.45e+154)
    		tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * sin(B)))) - t_0);
    	elseif (F <= 5000.0)
    		tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - t_0);
    	else
    		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.45e+154], N[(N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5000.0], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_0 := \frac{x}{\tan B}\\
    \mathbf{if}\;F \leq -2.45 \cdot 10^{+154}:\\
    \;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t\_0\\
    
    \mathbf{elif}\;F \leq 5000:\\
    \;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{\sin B} - t\_0\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -2.4500000000000001e154

      1. Initial program 77.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. 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-neg.f64N/A

          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      7. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto F \cdot \frac{-1}{F \cdot \color{blue}{\sin B}} - \frac{x}{\tan B} \]
        3. lower-sin.f6455.0%

          \[\leadsto F \cdot \frac{-1}{F \cdot \sin B} - \frac{x}{\tan B} \]
      8. Applied rewrites55.0%

        \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot \sin B}} - \frac{x}{\tan B} \]

      if -2.4500000000000001e154 < F < 5e3

      1. Initial program 77.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. 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-neg.f64N/A

          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
        5. lower--.f6477.2%

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

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

      if 5e3 < F

      1. Initial program 77.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. 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-neg.f64N/A

          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
        5. lower--.f6477.2%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
      5. Step-by-step derivation
        1. Applied rewrites55.0%

          \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
      6. Recombined 3 regimes into one program.
      7. Add Preprocessing

      Alternative 3: 98.9% accurate, 1.1× speedup?

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

        1. Initial program 77.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. 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-neg.f64N/A

            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
          5. lower--.f6477.2%

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

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

          \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
        5. Step-by-step derivation
          1. Applied rewrites56.2%

            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]

          if -410 < F < 3.1999999999999998e-10

          1. Initial program 77.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. 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-neg.f64N/A

              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
            5. lower--.f6477.2%

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

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

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

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

            if 3.1999999999999998e-10 < F

            1. Initial program 77.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. 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-neg.f64N/A

                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
              5. lower--.f6477.2%

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

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

              \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
            5. Step-by-step derivation
              1. Applied rewrites55.0%

                \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
            6. Recombined 3 regimes into one program.
            7. Add Preprocessing

            Alternative 4: 98.9% accurate, 1.1× speedup?

            \[\begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -410:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-10}:\\ \;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}, F, \cos B \cdot \left(-x\right)\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0 (/ x (tan B))))
               (if (<= F -410.0)
                 (- (/ -1.0 (sin B)) t_0)
                 (if (<= F 3.2e-10)
                   (/ (fma (pow (fma 2.0 x 2.0) -0.5) F (* (cos B) (- x))) (sin B))
                   (- (/ 1.0 (sin B)) t_0)))))
            double code(double F, double B, double x) {
            	double t_0 = x / tan(B);
            	double tmp;
            	if (F <= -410.0) {
            		tmp = (-1.0 / sin(B)) - t_0;
            	} else if (F <= 3.2e-10) {
            		tmp = fma(pow(fma(2.0, x, 2.0), -0.5), F, (cos(B) * -x)) / sin(B);
            	} else {
            		tmp = (1.0 / sin(B)) - t_0;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = Float64(x / tan(B))
            	tmp = 0.0
            	if (F <= -410.0)
            		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
            	elseif (F <= 3.2e-10)
            		tmp = Float64(fma((fma(2.0, x, 2.0) ^ -0.5), F, Float64(cos(B) * Float64(-x))) / sin(B));
            	else
            		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -410.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.2e-10], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
            
            \begin{array}{l}
            t_0 := \frac{x}{\tan B}\\
            \mathbf{if}\;F \leq -410:\\
            \;\;\;\;\frac{-1}{\sin B} - t\_0\\
            
            \mathbf{elif}\;F \leq 3.2 \cdot 10^{-10}:\\
            \;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}, F, \cos B \cdot \left(-x\right)\right)}{\sin B}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{1}{\sin B} - t\_0\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if F < -410

              1. Initial program 77.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. 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-neg.f64N/A

                  \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                5. lower--.f6477.2%

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

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

                \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
              5. Step-by-step derivation
                1. Applied rewrites56.2%

                  \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]

                if -410 < F < 3.1999999999999998e-10

                1. Initial program 77.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. 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. 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. 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)} \]
                  4. 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}} \]
                  5. add-to-fractionN/A

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

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

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

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

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

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

                    \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                  5. lower-pow.f64N/A

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

                    \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                  7. lower-*.f6456.5%

                    \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\right)}{\sin B} \]
                6. Applied rewrites56.5%

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\mathsf{fma}\left({\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}, F, -1 \cdot \left(x \cdot \cos B\right)\right)}{\sin B} \]
                  9. +-commutativeN/A

                    \[\leadsto \frac{\mathsf{fma}\left({\left(2 \cdot x + 2\right)}^{\frac{-1}{2}}, F, -1 \cdot \left(x \cdot \cos B\right)\right)}{\sin B} \]
                  10. lower-fma.f6456.5%

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

                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{\frac{-1}{2}}, F, -1 \cdot \left(x \cdot \cos B\right)\right)}{\sin B} \]
                  12. mul-1-negN/A

                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{\frac{-1}{2}}, F, \mathsf{neg}\left(x \cdot \cos B\right)\right)}{\sin B} \]
                  13. lift-*.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{\frac{-1}{2}}, F, \mathsf{neg}\left(x \cdot \cos B\right)\right)}{\sin B} \]
                  14. *-commutativeN/A

                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{\frac{-1}{2}}, F, \mathsf{neg}\left(\cos B \cdot x\right)\right)}{\sin B} \]
                  15. distribute-rgt-neg-inN/A

                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{\frac{-1}{2}}, F, \cos B \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}{\sin B} \]
                  16. lower-*.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{\frac{-1}{2}}, F, \cos B \cdot \left(\mathsf{neg}\left(x\right)\right)\right)}{\sin B} \]
                  17. lower-neg.f6456.5%

                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}, F, \cos B \cdot \left(-x\right)\right)}{\sin B} \]
                8. Applied rewrites56.5%

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

                if 3.1999999999999998e-10 < F

                1. Initial program 77.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. 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-neg.f64N/A

                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                  5. lower--.f6477.2%

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

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

                  \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                5. Step-by-step derivation
                  1. Applied rewrites55.0%

                    \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                6. Recombined 3 regimes into one program.
                7. Add Preprocessing

                Alternative 5: 98.8% accurate, 1.1× speedup?

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

                  1. Initial program 77.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. 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-neg.f64N/A

                      \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                    4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                    5. lower--.f6477.2%

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

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

                    \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                  5. Step-by-step derivation
                    1. Applied rewrites56.2%

                      \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]

                    if -410 < F < 2.1000000000000002e-9

                    1. Initial program 77.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. 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. 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. 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)} \]
                      4. 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}} \]
                      5. add-to-fractionN/A

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

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

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

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

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

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

                        \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                      4. lower-*.f64N/A

                        \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                      5. lower-pow.f64N/A

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

                        \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                      7. lower-*.f6456.5%

                        \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\right)}{\sin B} \]
                    6. Applied rewrites56.5%

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

                      \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {2}^{\frac{-1}{2}}\right)}{\sin B} \]
                    8. Step-by-step derivation
                      1. metadata-evalN/A

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

                        \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {2}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)}{\sin B} \]
                      3. lower-pow.f64N/A

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

                        \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {2}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)}{\sin B} \]
                      5. metadata-eval58.5%

                        \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {2}^{-0.5}\right)}{\sin B} \]
                    9. Applied rewrites58.5%

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

                    if 2.1000000000000002e-9 < F

                    1. Initial program 77.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. 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-neg.f64N/A

                        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                      5. lower--.f6477.2%

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

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

                      \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                    5. Step-by-step derivation
                      1. Applied rewrites55.0%

                        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                    6. Recombined 3 regimes into one program.
                    7. Add Preprocessing

                    Alternative 6: 90.9% accurate, 1.3× speedup?

                    \[\begin{array}{l} t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -15000000000000:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t\_1\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-22}:\\ \;\;\;\;\frac{t\_0 \cdot F}{B} - t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_1\\ \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (t_1 (/ x (tan B))))
                       (if (<= F -15000000000000.0)
                         (- (* F (/ -1.0 (* F (sin B)))) t_1)
                         (if (<= F -3.7e-180)
                           (/ (fma t_0 F (* -1.0 x)) (sin B))
                           (if (<= F 4e-22) (- (/ (* t_0 F) B) t_1) (- (/ 1.0 (sin B)) t_1))))))
                    double code(double F, double B, double x) {
                    	double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
                    	double t_1 = x / tan(B);
                    	double tmp;
                    	if (F <= -15000000000000.0) {
                    		tmp = (F * (-1.0 / (F * sin(B)))) - t_1;
                    	} else if (F <= -3.7e-180) {
                    		tmp = fma(t_0, F, (-1.0 * x)) / sin(B);
                    	} else if (F <= 4e-22) {
                    		tmp = ((t_0 * F) / B) - t_1;
                    	} else {
                    		tmp = (1.0 / sin(B)) - t_1;
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5
                    	t_1 = Float64(x / tan(B))
                    	tmp = 0.0
                    	if (F <= -15000000000000.0)
                    		tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * sin(B)))) - t_1);
                    	elseif (F <= -3.7e-180)
                    		tmp = Float64(fma(t_0, F, Float64(-1.0 * x)) / sin(B));
                    	elseif (F <= 4e-22)
                    		tmp = Float64(Float64(Float64(t_0 * F) / B) - t_1);
                    	else
                    		tmp = Float64(Float64(1.0 / sin(B)) - t_1);
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -15000000000000.0], N[(N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.7e-180], N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-22], N[(N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
                    
                    \begin{array}{l}
                    t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
                    t_1 := \frac{x}{\tan B}\\
                    \mathbf{if}\;F \leq -15000000000000:\\
                    \;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t\_1\\
                    
                    \mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\
                    \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\
                    
                    \mathbf{elif}\;F \leq 4 \cdot 10^{-22}:\\
                    \;\;\;\;\frac{t\_0 \cdot F}{B} - t\_1\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1}{\sin B} - t\_1\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if F < -1.5e13

                      1. Initial program 77.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. 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-neg.f64N/A

                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
                      7. Step-by-step derivation
                        1. lower-/.f64N/A

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

                          \[\leadsto F \cdot \frac{-1}{F \cdot \color{blue}{\sin B}} - \frac{x}{\tan B} \]
                        3. lower-sin.f6455.0%

                          \[\leadsto F \cdot \frac{-1}{F \cdot \sin B} - \frac{x}{\tan B} \]
                      8. Applied rewrites55.0%

                        \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot \sin B}} - \frac{x}{\tan B} \]

                      if -1.5e13 < F < -3.7000000000000002e-180

                      1. Initial program 77.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. 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. 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. 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)} \]
                        4. 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}} \]
                        5. add-to-fractionN/A

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

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

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

                        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \color{blue}{-1 \cdot x}\right)}{\sin B} \]
                      5. Step-by-step derivation
                        1. lower-*.f6460.0%

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

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

                      if -3.7000000000000002e-180 < F < 4.0000000000000002e-22

                      1. Initial program 77.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. 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-neg.f64N/A

                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                        5. lower--.f6477.2%

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

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

                        \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\color{blue}{B}} - \frac{x}{\tan B} \]
                      5. Step-by-step derivation
                        1. Applied rewrites70.5%

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

                        if 4.0000000000000002e-22 < F

                        1. Initial program 77.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. 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-neg.f64N/A

                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                          5. lower--.f6477.2%

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

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

                          \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                        5. Step-by-step derivation
                          1. Applied rewrites55.0%

                            \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                        6. Recombined 4 regimes into one program.
                        7. Add Preprocessing

                        Alternative 7: 90.2% accurate, 1.3× speedup?

                        \[\begin{array}{l} t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\ t_1 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.1 \cdot 10^{+67}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_1\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-22}:\\ \;\;\;\;\frac{t\_0 \cdot F}{B} - t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_1\\ \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (t_1 (/ x (tan B))))
                           (if (<= F -2.1e+67)
                             (- (/ -1.0 (sin B)) t_1)
                             (if (<= F -3.7e-180)
                               (/ (fma t_0 F (* -1.0 x)) (sin B))
                               (if (<= F 4e-22) (- (/ (* t_0 F) B) t_1) (- (/ 1.0 (sin B)) t_1))))))
                        double code(double F, double B, double x) {
                        	double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
                        	double t_1 = x / tan(B);
                        	double tmp;
                        	if (F <= -2.1e+67) {
                        		tmp = (-1.0 / sin(B)) - t_1;
                        	} else if (F <= -3.7e-180) {
                        		tmp = fma(t_0, F, (-1.0 * x)) / sin(B);
                        	} else if (F <= 4e-22) {
                        		tmp = ((t_0 * F) / B) - t_1;
                        	} else {
                        		tmp = (1.0 / sin(B)) - t_1;
                        	}
                        	return tmp;
                        }
                        
                        function code(F, B, x)
                        	t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5
                        	t_1 = Float64(x / tan(B))
                        	tmp = 0.0
                        	if (F <= -2.1e+67)
                        		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
                        	elseif (F <= -3.7e-180)
                        		tmp = Float64(fma(t_0, F, Float64(-1.0 * x)) / sin(B));
                        	elseif (F <= 4e-22)
                        		tmp = Float64(Float64(Float64(t_0 * F) / B) - t_1);
                        	else
                        		tmp = Float64(Float64(1.0 / sin(B)) - t_1);
                        	end
                        	return tmp
                        end
                        
                        code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.1e+67], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.7e-180], N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-22], N[(N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
                        
                        \begin{array}{l}
                        t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
                        t_1 := \frac{x}{\tan B}\\
                        \mathbf{if}\;F \leq -2.1 \cdot 10^{+67}:\\
                        \;\;\;\;\frac{-1}{\sin B} - t\_1\\
                        
                        \mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\
                        \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\
                        
                        \mathbf{elif}\;F \leq 4 \cdot 10^{-22}:\\
                        \;\;\;\;\frac{t\_0 \cdot F}{B} - t\_1\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{1}{\sin B} - t\_1\\
                        
                        
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if F < -2.1000000000000001e67

                          1. Initial program 77.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. 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-neg.f64N/A

                              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                            5. lower--.f6477.2%

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

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

                            \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                          5. Step-by-step derivation
                            1. Applied rewrites56.2%

                              \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]

                            if -2.1000000000000001e67 < F < -3.7000000000000002e-180

                            1. Initial program 77.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. 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. 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. 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)} \]
                              4. 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}} \]
                              5. add-to-fractionN/A

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

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

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

                              \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \color{blue}{-1 \cdot x}\right)}{\sin B} \]
                            5. Step-by-step derivation
                              1. lower-*.f6460.0%

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

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

                            if -3.7000000000000002e-180 < F < 4.0000000000000002e-22

                            1. Initial program 77.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. 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-neg.f64N/A

                                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                              5. lower--.f6477.2%

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

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

                              \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\color{blue}{B}} - \frac{x}{\tan B} \]
                            5. Step-by-step derivation
                              1. Applied rewrites70.5%

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

                              if 4.0000000000000002e-22 < F

                              1. Initial program 77.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. 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-neg.f64N/A

                                  \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                5. lower--.f6477.2%

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

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

                                \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                              5. Step-by-step derivation
                                1. Applied rewrites55.0%

                                  \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                              6. Recombined 4 regimes into one program.
                              7. Add Preprocessing

                              Alternative 8: 84.8% accurate, 1.4× speedup?

                              \[\begin{array}{l} t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\ t_1 := \frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\ t_2 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.1 \cdot 10^{+67}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_2\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-23}:\\ \;\;\;\;\frac{t\_0 \cdot F}{B} - t\_2\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{+61}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - t\_2\\ \end{array} \]
                              (FPCore (F B x)
                               :precision binary64
                               (let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5))
                                      (t_1 (/ (fma t_0 F (* -1.0 x)) (sin B)))
                                      (t_2 (/ x (tan B))))
                                 (if (<= F -2.1e+67)
                                   (- (/ -1.0 (sin B)) t_2)
                                   (if (<= F -3.7e-180)
                                     t_1
                                     (if (<= F 5e-23)
                                       (- (/ (* t_0 F) B) t_2)
                                       (if (<= F 9.6e+61)
                                         t_1
                                         (-
                                          (/ 1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
                                          t_2)))))))
                              double code(double F, double B, double x) {
                              	double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
                              	double t_1 = fma(t_0, F, (-1.0 * x)) / sin(B);
                              	double t_2 = x / tan(B);
                              	double tmp;
                              	if (F <= -2.1e+67) {
                              		tmp = (-1.0 / sin(B)) - t_2;
                              	} else if (F <= -3.7e-180) {
                              		tmp = t_1;
                              	} else if (F <= 5e-23) {
                              		tmp = ((t_0 * F) / B) - t_2;
                              	} else if (F <= 9.6e+61) {
                              		tmp = t_1;
                              	} else {
                              		tmp = (1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))))) - t_2;
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5
                              	t_1 = Float64(fma(t_0, F, Float64(-1.0 * x)) / sin(B))
                              	t_2 = Float64(x / tan(B))
                              	tmp = 0.0
                              	if (F <= -2.1e+67)
                              		tmp = Float64(Float64(-1.0 / sin(B)) - t_2);
                              	elseif (F <= -3.7e-180)
                              		tmp = t_1;
                              	elseif (F <= 5e-23)
                              		tmp = Float64(Float64(Float64(t_0 * F) / B) - t_2);
                              	elseif (F <= 9.6e+61)
                              		tmp = t_1;
                              	else
                              		tmp = Float64(Float64(1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))) - t_2);
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.1e+67], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, -3.7e-180], t$95$1, If[LessEqual[F, 5e-23], N[(N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, 9.6e+61], t$95$1, N[(N[(1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]
                              
                              \begin{array}{l}
                              t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
                              t_1 := \frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{\sin B}\\
                              t_2 := \frac{x}{\tan B}\\
                              \mathbf{if}\;F \leq -2.1 \cdot 10^{+67}:\\
                              \;\;\;\;\frac{-1}{\sin B} - t\_2\\
                              
                              \mathbf{elif}\;F \leq -3.7 \cdot 10^{-180}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;F \leq 5 \cdot 10^{-23}:\\
                              \;\;\;\;\frac{t\_0 \cdot F}{B} - t\_2\\
                              
                              \mathbf{elif}\;F \leq 9.6 \cdot 10^{+61}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - t\_2\\
                              
                              
                              \end{array}
                              
                              Derivation
                              1. Split input into 4 regimes
                              2. if F < -2.1000000000000001e67

                                1. Initial program 77.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. 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-neg.f64N/A

                                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                  5. lower--.f6477.2%

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

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

                                  \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]
                                5. Step-by-step derivation
                                  1. Applied rewrites56.2%

                                    \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{\tan B} \]

                                  if -2.1000000000000001e67 < F < -3.7000000000000002e-180 or 5.0000000000000002e-23 < F < 9.5999999999999995e61

                                  1. Initial program 77.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. 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. 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. 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)} \]
                                    4. 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}} \]
                                    5. add-to-fractionN/A

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

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

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

                                    \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \color{blue}{-1 \cdot x}\right)}{\sin B} \]
                                  5. Step-by-step derivation
                                    1. lower-*.f6460.0%

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

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

                                  if -3.7000000000000002e-180 < F < 5.0000000000000002e-23

                                  1. Initial program 77.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. 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-neg.f64N/A

                                      \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                    4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                    5. lower--.f6477.2%

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

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

                                    \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\color{blue}{B}} - \frac{x}{\tan B} \]
                                  5. Step-by-step derivation
                                    1. Applied rewrites70.5%

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

                                    if 9.5999999999999995e61 < F

                                    1. Initial program 77.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. 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-neg.f64N/A

                                        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                      5. lower--.f6477.2%

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

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

                                      \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                    5. Step-by-step derivation
                                      1. Applied rewrites55.0%

                                        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                      2. Taylor expanded in B around 0

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

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

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

                                          \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{B}^{2}}\right)} - \frac{x}{\tan B} \]
                                        4. lower-pow.f6454.9%

                                          \[\leadsto \frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{\color{blue}{2}}\right)} - \frac{x}{\tan B} \]
                                      4. Applied rewrites54.9%

                                        \[\leadsto \frac{1}{\color{blue}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}} - \frac{x}{\tan B} \]
                                    6. Recombined 4 regimes into one program.
                                    7. Add Preprocessing

                                    Alternative 9: 79.4% accurate, 0.3× speedup?

                                    \[\begin{array}{l} t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\ t_1 := \sin \left(\left|B\right|\right)\\ t_2 := \tan \left(\left|B\right|\right)\\ t_3 := \frac{x}{t\_2}\\ t_4 := \left(-x \cdot \frac{1}{t\_2}\right) + \frac{F}{t\_1} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ t_5 := \frac{t\_0 \cdot F}{\left|B\right|} - t\_3\\ \mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq -20000000000:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;t\_4 \leq 10:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{t\_1}\\ \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+198}:\\ \;\;\;\;t\_5\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)} - t\_3\\ \end{array} \end{array} \]
                                    (FPCore (F B x)
                                     :precision binary64
                                     (let* ((t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5))
                                            (t_1 (sin (fabs B)))
                                            (t_2 (tan (fabs B)))
                                            (t_3 (/ x t_2))
                                            (t_4
                                             (+
                                              (- (* x (/ 1.0 t_2)))
                                              (* (/ F t_1) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
                                            (t_5 (- (/ (* t_0 F) (fabs B)) t_3)))
                                       (*
                                        (copysign 1.0 B)
                                        (if (<= t_4 -20000000000.0)
                                          t_5
                                          (if (<= t_4 10.0)
                                            (/ (fma t_0 F (* -1.0 x)) t_1)
                                            (if (<= t_4 2e+198)
                                              t_5
                                              (-
                                               (/
                                                1.0
                                                (* (fabs B) (+ 1.0 (* -0.16666666666666666 (pow (fabs B) 2.0)))))
                                               t_3)))))))
                                    double code(double F, double B, double x) {
                                    	double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
                                    	double t_1 = sin(fabs(B));
                                    	double t_2 = tan(fabs(B));
                                    	double t_3 = x / t_2;
                                    	double t_4 = -(x * (1.0 / t_2)) + ((F / t_1) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                    	double t_5 = ((t_0 * F) / fabs(B)) - t_3;
                                    	double tmp;
                                    	if (t_4 <= -20000000000.0) {
                                    		tmp = t_5;
                                    	} else if (t_4 <= 10.0) {
                                    		tmp = fma(t_0, F, (-1.0 * x)) / t_1;
                                    	} else if (t_4 <= 2e+198) {
                                    		tmp = t_5;
                                    	} else {
                                    		tmp = (1.0 / (fabs(B) * (1.0 + (-0.16666666666666666 * pow(fabs(B), 2.0))))) - t_3;
                                    	}
                                    	return copysign(1.0, B) * tmp;
                                    }
                                    
                                    function code(F, B, x)
                                    	t_0 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5
                                    	t_1 = sin(abs(B))
                                    	t_2 = tan(abs(B))
                                    	t_3 = Float64(x / t_2)
                                    	t_4 = Float64(Float64(-Float64(x * Float64(1.0 / t_2))) + Float64(Float64(F / t_1) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
                                    	t_5 = Float64(Float64(Float64(t_0 * F) / abs(B)) - t_3)
                                    	tmp = 0.0
                                    	if (t_4 <= -20000000000.0)
                                    		tmp = t_5;
                                    	elseif (t_4 <= 10.0)
                                    		tmp = Float64(fma(t_0, F, Float64(-1.0 * x)) / t_1);
                                    	elseif (t_4 <= 2e+198)
                                    		tmp = t_5;
                                    	else
                                    		tmp = Float64(Float64(1.0 / Float64(abs(B) * Float64(1.0 + Float64(-0.16666666666666666 * (abs(B) ^ 2.0))))) - t_3);
                                    	end
                                    	return Float64(copysign(1.0, B) * tmp)
                                    end
                                    
                                    code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[B], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(x / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[((-N[(x * N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / t$95$1), $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$5 = N[(N[(N[(t$95$0 * F), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -20000000000.0], t$95$5, If[LessEqual[t$95$4, 10.0], N[(N[(t$95$0 * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 2e+198], t$95$5, N[(N[(1.0 / N[(N[Abs[B], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Power[N[Abs[B], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]]]]), $MachinePrecision]]]]]]]
                                    
                                    \begin{array}{l}
                                    t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
                                    t_1 := \sin \left(\left|B\right|\right)\\
                                    t_2 := \tan \left(\left|B\right|\right)\\
                                    t_3 := \frac{x}{t\_2}\\
                                    t_4 := \left(-x \cdot \frac{1}{t\_2}\right) + \frac{F}{t\_1} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
                                    t_5 := \frac{t\_0 \cdot F}{\left|B\right|} - t\_3\\
                                    \mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
                                    \mathbf{if}\;t\_4 \leq -20000000000:\\
                                    \;\;\;\;t\_5\\
                                    
                                    \mathbf{elif}\;t\_4 \leq 10:\\
                                    \;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, -1 \cdot x\right)}{t\_1}\\
                                    
                                    \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+198}:\\
                                    \;\;\;\;t\_5\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{1}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)} - t\_3\\
                                    
                                    
                                    \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)))))) < -2e10 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)))))) < 2e198

                                      1. Initial program 77.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. 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-neg.f64N/A

                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                        5. lower--.f6477.2%

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

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

                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\color{blue}{B}} - \frac{x}{\tan B} \]
                                      5. Step-by-step derivation
                                        1. Applied rewrites70.5%

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

                                        if -2e10 < (+.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 77.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. 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. 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. 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)} \]
                                          4. 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}} \]
                                          5. add-to-fractionN/A

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

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

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

                                          \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \color{blue}{-1 \cdot x}\right)}{\sin B} \]
                                        5. Step-by-step derivation
                                          1. lower-*.f6460.0%

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

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

                                        if 2e198 < (+.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 77.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. 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-neg.f64N/A

                                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                          5. lower--.f6477.2%

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

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

                                          \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                        5. Step-by-step derivation
                                          1. Applied rewrites55.0%

                                            \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                          2. Taylor expanded in B around 0

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

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

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

                                              \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{B}^{2}}\right)} - \frac{x}{\tan B} \]
                                            4. lower-pow.f6454.9%

                                              \[\leadsto \frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{\color{blue}{2}}\right)} - \frac{x}{\tan B} \]
                                          4. Applied rewrites54.9%

                                            \[\leadsto \frac{1}{\color{blue}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}} - \frac{x}{\tan B} \]
                                        6. Recombined 3 regimes into one program.
                                        7. Add Preprocessing

                                        Alternative 10: 76.4% accurate, 1.5× speedup?

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

                                          1. Initial program 77.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. 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-neg.f64N/A

                                              \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                            4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                            5. lower--.f6477.2%

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

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

                                            \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                          5. Step-by-step derivation
                                            1. Applied rewrites55.0%

                                              \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                            2. Taylor expanded in B around 0

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

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

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

                                                \[\leadsto \frac{1}{B \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{B}^{2}}\right)} - \frac{x}{\tan B} \]
                                              4. lower-pow.f6454.9%

                                                \[\leadsto \frac{1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{\color{blue}{2}}\right)} - \frac{x}{\tan B} \]
                                            4. Applied rewrites54.9%

                                              \[\leadsto \frac{1}{\color{blue}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}} - \frac{x}{\tan B} \]

                                            if -3.6e-9 < x < 4e-70

                                            1. Initial program 77.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. 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. 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. 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)} \]
                                              4. 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}} \]
                                              5. add-to-fractionN/A

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

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

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

                                              \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \color{blue}{-1 \cdot x}\right)}{\sin B} \]
                                            5. Step-by-step derivation
                                              1. lower-*.f6460.0%

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

                                              \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \color{blue}{-1 \cdot x}\right)}{\sin B} \]
                                          6. Recombined 2 regimes into one program.
                                          7. Add Preprocessing

                                          Alternative 11: 69.8% accurate, 1.5× speedup?

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

                                            1. Initial program 77.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. Taylor expanded in F around -inf

                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                              2. lower-sin.f6417.7%

                                                \[\leadsto \frac{-1}{\sin B} \]
                                            4. Applied rewrites17.7%

                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                                            if -6.5999999999999997e154 < F < 2.05e131

                                            1. Initial program 77.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. 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. 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. 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)} \]
                                              4. 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}} \]
                                              5. add-to-fractionN/A

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

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

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

                                              \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \color{blue}{-1 \cdot x}\right)}{\sin B} \]
                                            5. Step-by-step derivation
                                              1. lower-*.f6460.0%

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

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

                                            if 2.05e131 < F

                                            1. Initial program 77.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. 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-neg.f64N/A

                                                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                              5. lower--.f6477.2%

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

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

                                              \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                            5. Step-by-step derivation
                                              1. Applied rewrites55.0%

                                                \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                              2. Taylor expanded in B around 0

                                                \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f6435.4%

                                                  \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                              4. Applied rewrites35.4%

                                                \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                            6. Recombined 3 regimes into one program.
                                            7. Add Preprocessing

                                            Alternative 12: 66.0% accurate, 1.6× speedup?

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

                                              1. Initial program 77.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. Taylor expanded in F around -inf

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                2. lower-sin.f6417.7%

                                                  \[\leadsto \frac{-1}{\sin B} \]
                                              4. Applied rewrites17.7%

                                                \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                                              if -2.5e7 < F < 3.1999999999999998e-10

                                              1. Initial program 77.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. 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. 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. 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)} \]
                                                4. 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}} \]
                                                5. add-to-fractionN/A

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

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

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

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

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                                                5. lower-pow.f64N/A

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                                                7. lower-*.f6456.5%

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\right)}{\sin B} \]
                                              6. Applied rewrites56.5%

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

                                                \[\leadsto \frac{\mathsf{fma}\left(-1, x, F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\right)}{\sin B} \]
                                              8. Step-by-step derivation
                                                1. Applied rewrites38.3%

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

                                                if 3.1999999999999998e-10 < F

                                                1. Initial program 77.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. 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-neg.f64N/A

                                                    \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                  4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                  5. lower--.f6477.2%

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

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

                                                  \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                                5. Step-by-step derivation
                                                  1. Applied rewrites55.0%

                                                    \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                                  2. Taylor expanded in B around 0

                                                    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                  3. Step-by-step derivation
                                                    1. lower-/.f6435.4%

                                                      \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                  4. Applied rewrites35.4%

                                                    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                6. Recombined 3 regimes into one program.
                                                7. Add Preprocessing

                                                Alternative 13: 57.9% accurate, 1.8× speedup?

                                                \[\begin{array}{l} \mathbf{if}\;F \leq -410:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -5.8 \cdot 10^{-121}:\\ \;\;\;\;\frac{F \cdot {2}^{-0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-22}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{B}, \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
                                                (FPCore (F B x)
                                                 :precision binary64
                                                 (if (<= F -410.0)
                                                   (/ -1.0 (sin B))
                                                   (if (<= F -5.8e-121)
                                                     (/ (* F (pow 2.0 -0.5)) (sin B))
                                                     (if (<= F 4.5e-22)
                                                       (fma
                                                        (pow (fma 2.0 x (fma F F 2.0)) -0.5)
                                                        (/ F B)
                                                        (/ (- (* (* (* B B) x) 0.3333333333333333) x) B))
                                                       (- (/ 1.0 (sin B)) (/ x B))))))
                                                double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -410.0) {
                                                		tmp = -1.0 / sin(B);
                                                	} else if (F <= -5.8e-121) {
                                                		tmp = (F * pow(2.0, -0.5)) / sin(B);
                                                	} else if (F <= 4.5e-22) {
                                                		tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / B), (((((B * B) * x) * 0.3333333333333333) - x) / B));
                                                	} else {
                                                		tmp = (1.0 / sin(B)) - (x / B);
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(F, B, x)
                                                	tmp = 0.0
                                                	if (F <= -410.0)
                                                		tmp = Float64(-1.0 / sin(B));
                                                	elseif (F <= -5.8e-121)
                                                		tmp = Float64(Float64(F * (2.0 ^ -0.5)) / sin(B));
                                                	elseif (F <= 4.5e-22)
                                                		tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / B), Float64(Float64(Float64(Float64(Float64(B * B) * x) * 0.3333333333333333) - x) / B));
                                                	else
                                                		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[F_, B_, x_] := If[LessEqual[F, -410.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.8e-121], N[(N[(F * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e-22], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision] + N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
                                                
                                                \begin{array}{l}
                                                \mathbf{if}\;F \leq -410:\\
                                                \;\;\;\;\frac{-1}{\sin B}\\
                                                
                                                \mathbf{elif}\;F \leq -5.8 \cdot 10^{-121}:\\
                                                \;\;\;\;\frac{F \cdot {2}^{-0.5}}{\sin B}\\
                                                
                                                \mathbf{elif}\;F \leq 4.5 \cdot 10^{-22}:\\
                                                \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{B}, \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\right)\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
                                                
                                                
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 4 regimes
                                                2. if F < -410

                                                  1. Initial program 77.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. Taylor expanded in F around -inf

                                                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                  3. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                    2. lower-sin.f6417.7%

                                                      \[\leadsto \frac{-1}{\sin B} \]
                                                  4. Applied rewrites17.7%

                                                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                                                  if -410 < F < -5.8e-121

                                                  1. Initial program 77.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. 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. 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. 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)} \]
                                                    4. 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}} \]
                                                    5. add-to-fractionN/A

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

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

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

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

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

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

                                                      \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                                                    4. lower-*.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                                                    5. lower-pow.f64N/A

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

                                                      \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{\frac{-1}{2}}\right)}{\sin B} \]
                                                    7. lower-*.f6456.5%

                                                      \[\leadsto \frac{\mathsf{fma}\left(-1, x \cdot \cos B, F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\right)}{\sin B} \]
                                                  6. Applied rewrites56.5%

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

                                                    \[\leadsto \frac{F \cdot \color{blue}{{2}^{\frac{-1}{2}}}}{\sin B} \]
                                                  8. Step-by-step derivation
                                                    1. metadata-evalN/A

                                                      \[\leadsto \frac{F \cdot {2}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \]
                                                    2. metadata-evalN/A

                                                      \[\leadsto \frac{F \cdot {2}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \]
                                                    3. lower-*.f64N/A

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

                                                      \[\leadsto \frac{F \cdot {2}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \]
                                                    5. metadata-evalN/A

                                                      \[\leadsto \frac{F \cdot {2}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B} \]
                                                    6. metadata-eval20.0%

                                                      \[\leadsto \frac{F \cdot {2}^{-0.5}}{\sin B} \]
                                                  9. Applied rewrites20.0%

                                                    \[\leadsto \frac{F \cdot \color{blue}{{2}^{-0.5}}}{\sin B} \]

                                                  if -5.8e-121 < F < 4.4999999999999999e-22

                                                  1. Initial program 77.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. Taylor expanded in B around 0

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

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

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

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

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

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

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

                                                      \[\leadsto \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    5. lower-pow.f6435.4%

                                                      \[\leadsto \frac{0.3333333333333333 \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  7. Applied rewrites35.4%

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

                                                      \[\leadsto \color{blue}{\frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{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}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B}} \]
                                                    3. lift-*.f64N/A

                                                      \[\leadsto \color{blue}{\frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} \]
                                                    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}{B}} + \frac{\frac{1}{3} \cdot \left({B}^{2} \cdot x\right) - x}{B} \]
                                                    5. lower-fma.f6435.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}{B}, \frac{0.3333333333333333 \cdot \left({B}^{2} \cdot x\right) - x}{B}\right)} \]
                                                  9. Applied rewrites35.4%

                                                    \[\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}{B}, \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\right)} \]

                                                  if 4.4999999999999999e-22 < F

                                                  1. Initial program 77.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. 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-neg.f64N/A

                                                      \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                    4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                    5. lower--.f6477.2%

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

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

                                                    \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                                  5. Step-by-step derivation
                                                    1. Applied rewrites55.0%

                                                      \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                                    2. Taylor expanded in B around 0

                                                      \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                    3. Step-by-step derivation
                                                      1. lower-/.f6435.4%

                                                        \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                    4. Applied rewrites35.4%

                                                      \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                  6. Recombined 4 regimes into one program.
                                                  7. Add Preprocessing

                                                  Alternative 14: 57.9% accurate, 2.3× speedup?

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

                                                    1. Initial program 77.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. Taylor expanded in F around -inf

                                                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                    3. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                      2. lower-sin.f6417.7%

                                                        \[\leadsto \frac{-1}{\sin B} \]
                                                    4. Applied rewrites17.7%

                                                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                                                    if -4.2e7 < F < 4.4999999999999999e-22

                                                    1. Initial program 77.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. 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-neg.f64N/A

                                                        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                      5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                        \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                      7. lower-pow.f6443.6%

                                                        \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                    6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                      2. sub-flipN/A

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

                                                        \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                      4. *-commutativeN/A

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

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

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

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

                                                        \[\leadsto \frac{{\left(2 + \left({F}^{2} + 2 \cdot x\right)\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                      9. associate-+l+N/A

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

                                                        \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                      11. lift-pow.f64N/A

                                                        \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                      12. pow2N/A

                                                        \[\leadsto \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                      13. lower-fma.f64N/A

                                                        \[\leadsto \frac{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    8. Applied rewrites43.6%

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

                                                    if 4.4999999999999999e-22 < F

                                                    1. Initial program 77.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. 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-neg.f64N/A

                                                        \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                      4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                      5. lower--.f6477.2%

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

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

                                                      \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                                    5. Step-by-step derivation
                                                      1. Applied rewrites55.0%

                                                        \[\leadsto \frac{\color{blue}{1}}{\sin B} - \frac{x}{\tan B} \]
                                                      2. Taylor expanded in B around 0

                                                        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                      3. Step-by-step derivation
                                                        1. lower-/.f6435.4%

                                                          \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{B}} \]
                                                      4. Applied rewrites35.4%

                                                        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
                                                    6. Recombined 3 regimes into one program.
                                                    7. Add Preprocessing

                                                    Alternative 15: 51.5% accurate, 2.7× speedup?

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

                                                      1. Initial program 77.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. Taylor expanded in F around -inf

                                                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                      3. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                        2. lower-sin.f6417.7%

                                                          \[\leadsto \frac{-1}{\sin B} \]
                                                      4. Applied rewrites17.7%

                                                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                                                      if -4.2e7 < F < 9.5999999999999999e54

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        2. sub-flipN/A

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        4. *-commutativeN/A

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

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

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

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

                                                          \[\leadsto \frac{{\left(2 + \left({F}^{2} + 2 \cdot x\right)\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        9. associate-+l+N/A

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

                                                          \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        11. lift-pow.f64N/A

                                                          \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        12. pow2N/A

                                                          \[\leadsto \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      8. Applied rewrites43.6%

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

                                                      if 9.5999999999999999e54 < F

                                                      1. Initial program 77.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. Taylor expanded in F around inf

                                                        \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                                      3. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                        2. lower-sin.f6416.0%

                                                          \[\leadsto \frac{1}{\sin B} \]
                                                      4. Applied rewrites16.0%

                                                        \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                                                    3. Recombined 3 regimes into one program.
                                                    4. Add Preprocessing

                                                    Alternative 16: 51.4% accurate, 2.7× speedup?

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

                                                      1. Initial program 77.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. Taylor expanded in F around -inf

                                                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                      3. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                        2. lower-sin.f6417.7%

                                                          \[\leadsto \frac{-1}{\sin B} \]
                                                      4. Applied rewrites17.7%

                                                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                                                      if -4.2e7 < F < 1.3e-11

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        2. sub-flipN/A

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        4. *-commutativeN/A

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

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

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

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

                                                          \[\leadsto \frac{{\left(2 + \left({F}^{2} + 2 \cdot x\right)\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        9. associate-+l+N/A

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

                                                          \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        11. lift-pow.f64N/A

                                                          \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        12. pow2N/A

                                                          \[\leadsto \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      8. Applied rewrites43.6%

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

                                                      if 1.3e-11 < F

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6428.9%

                                                          \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      9. Applied rewrites28.9%

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                    3. Recombined 3 regimes into one program.
                                                    4. Add Preprocessing

                                                    Alternative 17: 50.5% accurate, 2.7× speedup?

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

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6429.5%

                                                          \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      9. Applied rewrites29.5%

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]

                                                      if -3.6999999999999999e154 < F < 1.3e-11

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        2. sub-flipN/A

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        4. *-commutativeN/A

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

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

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

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

                                                          \[\leadsto \frac{{\left(2 + \left({F}^{2} + 2 \cdot x\right)\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        9. associate-+l+N/A

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

                                                          \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        11. lift-pow.f64N/A

                                                          \[\leadsto \frac{{\left(\left({F}^{2} + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        12. pow2N/A

                                                          \[\leadsto \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\frac{-1}{2}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      8. Applied rewrites43.6%

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

                                                      if 1.3e-11 < F

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6428.9%

                                                          \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      9. Applied rewrites28.9%

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                    3. Recombined 3 regimes into one program.
                                                    4. Add Preprocessing

                                                    Alternative 18: 50.5% accurate, 3.0× speedup?

                                                    \[\begin{array}{l} \mathbf{if}\;F \leq -410:\\ \;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\ \mathbf{elif}\;F \leq 5000:\\ \;\;\;\;\frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\ \end{array} \]
                                                    (FPCore (F B x)
                                                     :precision binary64
                                                     (if (<= F -410.0)
                                                       (/ (- (* F (/ -1.0 F)) x) B)
                                                       (if (<= F 5000.0)
                                                         (/ (- (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) x) B)
                                                         (/ (- (* F (/ 1.0 F)) x) B))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -410.0) {
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	} else if (F <= 5000.0) {
                                                    		tmp = ((F * pow((2.0 + (2.0 * x)), -0.5)) - x) / B;
                                                    	} else {
                                                    		tmp = ((F * (1.0 / F)) - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    module fmin_fmax_functions
                                                        implicit none
                                                        private
                                                        public fmax
                                                        public fmin
                                                    
                                                        interface fmax
                                                            module procedure fmax88
                                                            module procedure fmax44
                                                            module procedure fmax84
                                                            module procedure fmax48
                                                        end interface
                                                        interface fmin
                                                            module procedure fmin88
                                                            module procedure fmin44
                                                            module procedure fmin84
                                                            module procedure fmin48
                                                        end interface
                                                    contains
                                                        real(8) function fmax88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmax44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmin44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                        end function
                                                    end module
                                                    
                                                    real(8) function code(f, b, x)
                                                    use fmin_fmax_functions
                                                        real(8), intent (in) :: f
                                                        real(8), intent (in) :: b
                                                        real(8), intent (in) :: x
                                                        real(8) :: tmp
                                                        if (f <= (-410.0d0)) then
                                                            tmp = ((f * ((-1.0d0) / f)) - x) / b
                                                        else if (f <= 5000.0d0) then
                                                            tmp = ((f * ((2.0d0 + (2.0d0 * x)) ** (-0.5d0))) - x) / b
                                                        else
                                                            tmp = ((f * (1.0d0 / f)) - x) / b
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    public static double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -410.0) {
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	} else if (F <= 5000.0) {
                                                    		tmp = ((F * Math.pow((2.0 + (2.0 * x)), -0.5)) - x) / B;
                                                    	} else {
                                                    		tmp = ((F * (1.0 / F)) - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(F, B, x):
                                                    	tmp = 0
                                                    	if F <= -410.0:
                                                    		tmp = ((F * (-1.0 / F)) - x) / B
                                                    	elif F <= 5000.0:
                                                    		tmp = ((F * math.pow((2.0 + (2.0 * x)), -0.5)) - x) / B
                                                    	else:
                                                    		tmp = ((F * (1.0 / F)) - x) / B
                                                    	return tmp
                                                    
                                                    function code(F, B, x)
                                                    	tmp = 0.0
                                                    	if (F <= -410.0)
                                                    		tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B);
                                                    	elseif (F <= 5000.0)
                                                    		tmp = Float64(Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) - x) / B);
                                                    	else
                                                    		tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) - x) / B);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(F, B, x)
                                                    	tmp = 0.0;
                                                    	if (F <= -410.0)
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	elseif (F <= 5000.0)
                                                    		tmp = ((F * ((2.0 + (2.0 * x)) ^ -0.5)) - x) / B;
                                                    	else
                                                    		tmp = ((F * (1.0 / F)) - x) / B;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[F_, B_, x_] := If[LessEqual[F, -410.0], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                    
                                                    \begin{array}{l}
                                                    \mathbf{if}\;F \leq -410:\\
                                                    \;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
                                                    
                                                    \mathbf{elif}\;F \leq 5000:\\
                                                    \;\;\;\;\frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\
                                                    
                                                    
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if F < -410

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6429.5%

                                                          \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      9. Applied rewrites29.5%

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]

                                                      if -410 < F < 5e3

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-*.f6429.5%

                                                          \[\leadsto \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B} \]
                                                      9. Applied rewrites29.5%

                                                        \[\leadsto \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B} \]

                                                      if 5e3 < F

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6428.9%

                                                          \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      9. Applied rewrites28.9%

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                    3. Recombined 3 regimes into one program.
                                                    4. Add Preprocessing

                                                    Alternative 19: 43.3% accurate, 4.4× speedup?

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

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6429.5%

                                                          \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      9. Applied rewrites29.5%

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]

                                                      if -5.5999999999999997e-55 < F < 6.9999999999999996e-54

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-*.f6429.2%

                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      9. Applied rewrites29.2%

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]

                                                      if 6.9999999999999996e-54 < F

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-*.f64N/A

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

                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                        3. lower-/.f64N/A

                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                        4. lower-/.f6428.0%

                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                      9. Applied rewrites28.0%

                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                    3. Recombined 3 regimes into one program.
                                                    4. Add Preprocessing

                                                    Alternative 20: 43.3% accurate, 5.6× speedup?

                                                    \[\begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{-55}:\\ \;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-54}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\ \end{array} \]
                                                    (FPCore (F B x)
                                                     :precision binary64
                                                     (if (<= F -5.6e-55)
                                                       (/ (- (* F (/ -1.0 F)) x) B)
                                                       (if (<= F 7e-54) (/ (* -1.0 x) B) (/ (- (* F (/ 1.0 F)) x) B))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -5.6e-55) {
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	} else if (F <= 7e-54) {
                                                    		tmp = (-1.0 * x) / B;
                                                    	} else {
                                                    		tmp = ((F * (1.0 / F)) - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    module fmin_fmax_functions
                                                        implicit none
                                                        private
                                                        public fmax
                                                        public fmin
                                                    
                                                        interface fmax
                                                            module procedure fmax88
                                                            module procedure fmax44
                                                            module procedure fmax84
                                                            module procedure fmax48
                                                        end interface
                                                        interface fmin
                                                            module procedure fmin88
                                                            module procedure fmin44
                                                            module procedure fmin84
                                                            module procedure fmin48
                                                        end interface
                                                    contains
                                                        real(8) function fmax88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmax44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmin44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                        end function
                                                    end module
                                                    
                                                    real(8) function code(f, b, x)
                                                    use fmin_fmax_functions
                                                        real(8), intent (in) :: f
                                                        real(8), intent (in) :: b
                                                        real(8), intent (in) :: x
                                                        real(8) :: tmp
                                                        if (f <= (-5.6d-55)) then
                                                            tmp = ((f * ((-1.0d0) / f)) - x) / b
                                                        else if (f <= 7d-54) then
                                                            tmp = ((-1.0d0) * x) / b
                                                        else
                                                            tmp = ((f * (1.0d0 / f)) - x) / b
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    public static double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -5.6e-55) {
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	} else if (F <= 7e-54) {
                                                    		tmp = (-1.0 * x) / B;
                                                    	} else {
                                                    		tmp = ((F * (1.0 / F)) - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(F, B, x):
                                                    	tmp = 0
                                                    	if F <= -5.6e-55:
                                                    		tmp = ((F * (-1.0 / F)) - x) / B
                                                    	elif F <= 7e-54:
                                                    		tmp = (-1.0 * x) / B
                                                    	else:
                                                    		tmp = ((F * (1.0 / F)) - x) / B
                                                    	return tmp
                                                    
                                                    function code(F, B, x)
                                                    	tmp = 0.0
                                                    	if (F <= -5.6e-55)
                                                    		tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B);
                                                    	elseif (F <= 7e-54)
                                                    		tmp = Float64(Float64(-1.0 * x) / B);
                                                    	else
                                                    		tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) - x) / B);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(F, B, x)
                                                    	tmp = 0.0;
                                                    	if (F <= -5.6e-55)
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	elseif (F <= 7e-54)
                                                    		tmp = (-1.0 * x) / B;
                                                    	else
                                                    		tmp = ((F * (1.0 / F)) - x) / B;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[F_, B_, x_] := If[LessEqual[F, -5.6e-55], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-54], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                    
                                                    \begin{array}{l}
                                                    \mathbf{if}\;F \leq -5.6 \cdot 10^{-55}:\\
                                                    \;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
                                                    
                                                    \mathbf{elif}\;F \leq 7 \cdot 10^{-54}:\\
                                                    \;\;\;\;\frac{-1 \cdot x}{B}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{F \cdot \frac{1}{F} - x}{B}\\
                                                    
                                                    
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if F < -5.5999999999999997e-55

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6429.5%

                                                          \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      9. Applied rewrites29.5%

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]

                                                      if -5.5999999999999997e-55 < F < 6.9999999999999996e-54

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-*.f6429.2%

                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      9. Applied rewrites29.2%

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]

                                                      if 6.9999999999999996e-54 < F

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6428.9%

                                                          \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                      9. Applied rewrites28.9%

                                                        \[\leadsto \frac{F \cdot \frac{1}{F} - x}{B} \]
                                                    3. Recombined 3 regimes into one program.
                                                    4. Add Preprocessing

                                                    Alternative 21: 35.9% accurate, 6.8× speedup?

                                                    \[\begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{-55}:\\ \;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
                                                    (FPCore (F B x)
                                                     :precision binary64
                                                     (if (<= F -5.6e-55)
                                                       (/ (- (* F (/ -1.0 F)) x) B)
                                                       (if (<= F 2.5e+164) (/ (* -1.0 x) B) (/ 1.0 B))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -5.6e-55) {
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	} else if (F <= 2.5e+164) {
                                                    		tmp = (-1.0 * x) / B;
                                                    	} else {
                                                    		tmp = 1.0 / 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 <= (-5.6d-55)) then
                                                            tmp = ((f * ((-1.0d0) / f)) - x) / b
                                                        else if (f <= 2.5d+164) then
                                                            tmp = ((-1.0d0) * x) / b
                                                        else
                                                            tmp = 1.0d0 / b
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    public static double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -5.6e-55) {
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	} else if (F <= 2.5e+164) {
                                                    		tmp = (-1.0 * x) / B;
                                                    	} else {
                                                    		tmp = 1.0 / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(F, B, x):
                                                    	tmp = 0
                                                    	if F <= -5.6e-55:
                                                    		tmp = ((F * (-1.0 / F)) - x) / B
                                                    	elif F <= 2.5e+164:
                                                    		tmp = (-1.0 * x) / B
                                                    	else:
                                                    		tmp = 1.0 / B
                                                    	return tmp
                                                    
                                                    function code(F, B, x)
                                                    	tmp = 0.0
                                                    	if (F <= -5.6e-55)
                                                    		tmp = Float64(Float64(Float64(F * Float64(-1.0 / F)) - x) / B);
                                                    	elseif (F <= 2.5e+164)
                                                    		tmp = Float64(Float64(-1.0 * x) / B);
                                                    	else
                                                    		tmp = Float64(1.0 / B);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(F, B, x)
                                                    	tmp = 0.0;
                                                    	if (F <= -5.6e-55)
                                                    		tmp = ((F * (-1.0 / F)) - x) / B;
                                                    	elseif (F <= 2.5e+164)
                                                    		tmp = (-1.0 * x) / B;
                                                    	else
                                                    		tmp = 1.0 / B;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[F_, B_, x_] := If[LessEqual[F, -5.6e-55], N[(N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e+164], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]]
                                                    
                                                    \begin{array}{l}
                                                    \mathbf{if}\;F \leq -5.6 \cdot 10^{-55}:\\
                                                    \;\;\;\;\frac{F \cdot \frac{-1}{F} - x}{B}\\
                                                    
                                                    \mathbf{elif}\;F \leq 2.5 \cdot 10^{+164}:\\
                                                    \;\;\;\;\frac{-1 \cdot x}{B}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{1}{B}\\
                                                    
                                                    
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if F < -5.5999999999999997e-55

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-/.f6429.5%

                                                          \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]
                                                      9. Applied rewrites29.5%

                                                        \[\leadsto \frac{F \cdot \frac{-1}{F} - x}{B} \]

                                                      if -5.5999999999999997e-55 < F < 2.4999999999999997e164

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      8. Step-by-step derivation
                                                        1. lower-*.f6429.2%

                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      9. Applied rewrites29.2%

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]

                                                      if 2.4999999999999997e164 < F

                                                      1. Initial program 77.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. 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-neg.f64N/A

                                                          \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                        4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                        5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                        7. lower-pow.f6443.6%

                                                          \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                      6. Applied rewrites43.6%

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

                                                        \[\leadsto \frac{1}{B} \]
                                                      8. Step-by-step derivation
                                                        1. Applied rewrites9.6%

                                                          \[\leadsto \frac{1}{B} \]
                                                      9. Recombined 3 regimes into one program.
                                                      10. Add Preprocessing

                                                      Alternative 22: 28.6% accurate, 10.5× speedup?

                                                      \[\begin{array}{l} \mathbf{if}\;F \leq 2.5 \cdot 10^{+164}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
                                                      (FPCore (F B x)
                                                       :precision binary64
                                                       (if (<= F 2.5e+164) (/ (* -1.0 x) B) (/ 1.0 B)))
                                                      double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= 2.5e+164) {
                                                      		tmp = (-1.0 * x) / B;
                                                      	} else {
                                                      		tmp = 1.0 / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      module fmin_fmax_functions
                                                          implicit none
                                                          private
                                                          public fmax
                                                          public fmin
                                                      
                                                          interface fmax
                                                              module procedure fmax88
                                                              module procedure fmax44
                                                              module procedure fmax84
                                                              module procedure fmax48
                                                          end interface
                                                          interface fmin
                                                              module procedure fmin88
                                                              module procedure fmin44
                                                              module procedure fmin84
                                                              module procedure fmin48
                                                          end interface
                                                      contains
                                                          real(8) function fmax88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmax44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmin44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                          end function
                                                      end module
                                                      
                                                      real(8) function code(f, b, x)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: f
                                                          real(8), intent (in) :: b
                                                          real(8), intent (in) :: x
                                                          real(8) :: tmp
                                                          if (f <= 2.5d+164) then
                                                              tmp = ((-1.0d0) * x) / b
                                                          else
                                                              tmp = 1.0d0 / b
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= 2.5e+164) {
                                                      		tmp = (-1.0 * x) / B;
                                                      	} else {
                                                      		tmp = 1.0 / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(F, B, x):
                                                      	tmp = 0
                                                      	if F <= 2.5e+164:
                                                      		tmp = (-1.0 * x) / B
                                                      	else:
                                                      		tmp = 1.0 / B
                                                      	return tmp
                                                      
                                                      function code(F, B, x)
                                                      	tmp = 0.0
                                                      	if (F <= 2.5e+164)
                                                      		tmp = Float64(Float64(-1.0 * x) / B);
                                                      	else
                                                      		tmp = Float64(1.0 / B);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(F, B, x)
                                                      	tmp = 0.0;
                                                      	if (F <= 2.5e+164)
                                                      		tmp = (-1.0 * x) / B;
                                                      	else
                                                      		tmp = 1.0 / B;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[F_, B_, x_] := If[LessEqual[F, 2.5e+164], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
                                                      
                                                      \begin{array}{l}
                                                      \mathbf{if}\;F \leq 2.5 \cdot 10^{+164}:\\
                                                      \;\;\;\;\frac{-1 \cdot x}{B}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;\frac{1}{B}\\
                                                      
                                                      
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 2 regimes
                                                      2. if F < 2.4999999999999997e164

                                                        1. Initial program 77.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. 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-neg.f64N/A

                                                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                          5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                            \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                          7. lower-pow.f6443.6%

                                                            \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                        6. Applied rewrites43.6%

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

                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                        8. Step-by-step derivation
                                                          1. lower-*.f6429.2%

                                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                                        9. Applied rewrites29.2%

                                                          \[\leadsto \frac{-1 \cdot x}{B} \]

                                                        if 2.4999999999999997e164 < F

                                                        1. Initial program 77.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. 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-neg.f64N/A

                                                            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                          4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                          5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                            \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                          7. lower-pow.f6443.6%

                                                            \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                        6. Applied rewrites43.6%

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

                                                          \[\leadsto \frac{1}{B} \]
                                                        8. Step-by-step derivation
                                                          1. Applied rewrites9.6%

                                                            \[\leadsto \frac{1}{B} \]
                                                        9. Recombined 2 regimes into one program.
                                                        10. Add Preprocessing

                                                        Alternative 23: 17.4% accurate, 14.2× speedup?

                                                        \[\begin{array}{l} \mathbf{if}\;F \leq 1.35 \cdot 10^{-111}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
                                                        (FPCore (F B x) :precision binary64 (if (<= F 1.35e-111) (/ -1.0 B) (/ 1.0 B)))
                                                        double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= 1.35e-111) {
                                                        		tmp = -1.0 / B;
                                                        	} else {
                                                        		tmp = 1.0 / 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.35d-111) then
                                                                tmp = (-1.0d0) / b
                                                            else
                                                                tmp = 1.0d0 / b
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= 1.35e-111) {
                                                        		tmp = -1.0 / B;
                                                        	} else {
                                                        		tmp = 1.0 / B;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(F, B, x):
                                                        	tmp = 0
                                                        	if F <= 1.35e-111:
                                                        		tmp = -1.0 / B
                                                        	else:
                                                        		tmp = 1.0 / B
                                                        	return tmp
                                                        
                                                        function code(F, B, x)
                                                        	tmp = 0.0
                                                        	if (F <= 1.35e-111)
                                                        		tmp = Float64(-1.0 / B);
                                                        	else
                                                        		tmp = Float64(1.0 / B);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(F, B, x)
                                                        	tmp = 0.0;
                                                        	if (F <= 1.35e-111)
                                                        		tmp = -1.0 / B;
                                                        	else
                                                        		tmp = 1.0 / B;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[F_, B_, x_] := If[LessEqual[F, 1.35e-111], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        \mathbf{if}\;F \leq 1.35 \cdot 10^{-111}:\\
                                                        \;\;\;\;\frac{-1}{B}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\frac{1}{B}\\
                                                        
                                                        
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if F < 1.3499999999999999e-111

                                                          1. Initial program 77.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. Taylor expanded in F around -inf

                                                            \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                          3. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                            2. lower-sin.f6417.7%

                                                              \[\leadsto \frac{-1}{\sin B} \]
                                                          4. Applied rewrites17.7%

                                                            \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                          5. Taylor expanded in B around 0

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

                                                              \[\leadsto \frac{-1}{B} \]

                                                            if 1.3499999999999999e-111 < F

                                                            1. Initial program 77.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. 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-neg.f64N/A

                                                                \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                              4. sub-flip-reverseN/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)} - x \cdot \frac{1}{\tan B}} \]
                                                              5. lower--.f6477.2%

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

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

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

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

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

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

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

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

                                                                \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B} \]
                                                              7. lower-pow.f6443.6%

                                                                \[\leadsto \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B} \]
                                                            6. Applied rewrites43.6%

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

                                                              \[\leadsto \frac{1}{B} \]
                                                            8. Step-by-step derivation
                                                              1. Applied rewrites9.6%

                                                                \[\leadsto \frac{1}{B} \]
                                                            9. Recombined 2 regimes into one program.
                                                            10. Add Preprocessing

                                                            Alternative 24: 10.7% accurate, 25.4× speedup?

                                                            \[\frac{-1}{B} \]
                                                            (FPCore (F B x) :precision binary64 (/ -1.0 B))
                                                            double code(double F, double B, double x) {
                                                            	return -1.0 / B;
                                                            }
                                                            
                                                            module fmin_fmax_functions
                                                                implicit none
                                                                private
                                                                public fmax
                                                                public fmin
                                                            
                                                                interface fmax
                                                                    module procedure fmax88
                                                                    module procedure fmax44
                                                                    module procedure fmax84
                                                                    module procedure fmax48
                                                                end interface
                                                                interface fmin
                                                                    module procedure fmin88
                                                                    module procedure fmin44
                                                                    module procedure fmin84
                                                                    module procedure fmin48
                                                                end interface
                                                            contains
                                                                real(8) function fmax88(x, y) result (res)
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                end function
                                                                real(4) function fmax44(x, y) result (res)
                                                                    real(4), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmax84(x, y) result(res)
                                                                    real(8), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmax48(x, y) result(res)
                                                                    real(4), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin88(x, y) result (res)
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                end function
                                                                real(4) function fmin44(x, y) result (res)
                                                                    real(4), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin84(x, y) result(res)
                                                                    real(8), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin48(x, y) result(res)
                                                                    real(4), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                end function
                                                            end module
                                                            
                                                            real(8) function code(f, b, x)
                                                            use fmin_fmax_functions
                                                                real(8), intent (in) :: f
                                                                real(8), intent (in) :: b
                                                                real(8), intent (in) :: x
                                                                code = (-1.0d0) / b
                                                            end function
                                                            
                                                            public static double code(double F, double B, double x) {
                                                            	return -1.0 / B;
                                                            }
                                                            
                                                            def code(F, B, x):
                                                            	return -1.0 / B
                                                            
                                                            function code(F, B, x)
                                                            	return Float64(-1.0 / B)
                                                            end
                                                            
                                                            function tmp = code(F, B, x)
                                                            	tmp = -1.0 / B;
                                                            end
                                                            
                                                            code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                                                            
                                                            \frac{-1}{B}
                                                            
                                                            Derivation
                                                            1. Initial program 77.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. Taylor expanded in F around -inf

                                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                            3. Step-by-step derivation
                                                              1. lower-/.f64N/A

                                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                              2. lower-sin.f6417.7%

                                                                \[\leadsto \frac{-1}{\sin B} \]
                                                            4. Applied rewrites17.7%

                                                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                                                            5. Taylor expanded in B around 0

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

                                                                \[\leadsto \frac{-1}{B} \]
                                                              2. Add Preprocessing

                                                              Reproduce

                                                              ?
                                                              herbie shell --seed 2025205 
                                                              (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))))))