VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.0% → 98.5%
Time: 11.4s
Alternatives: 26
Speedup: 2.2×

Specification

?
\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 26 alternatives:

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

Initial Program: 77.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Alternative 1: 98.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -2.05 \cdot 10^{+115}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 53.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf

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

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

      if -2.04999999999999981e115 < F < 9.5999999999999997e-21

      1. Initial program 96.0%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

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

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

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

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

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

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

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

      if 9.5999999999999997e-21 < F

      1. Initial program 60.7%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around inf

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

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

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

      Alternative 2: 98.5% accurate, 1.3× speedup?

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

        1. Initial program 53.3%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in F around -inf

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

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

          if -2.04999999999999981e115 < F < 9.5999999999999997e-21

          1. Initial program 96.0%

            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 9.5999999999999997e-21 < F

          1. Initial program 60.7%

            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in F around inf

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

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

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

          Alternative 3: 98.4% accurate, 1.3× speedup?

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

            1. Initial program 61.1%

              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in F around -inf

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
            4. Step-by-step derivation
              1. Applied rewrites99.7%

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

              if -2.3500000000000001e31 < F < 9.5999999999999997e-21

              1. Initial program 99.5%

                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in x around 0

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

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

                if 9.5999999999999997e-21 < F

                1. Initial program 60.7%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in F around inf

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

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

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

                Alternative 4: 98.2% accurate, 1.4× speedup?

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

                  1. Initial program 63.3%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in F around -inf

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

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

                    if -2 < F < 9.5999999999999997e-21

                    1. Initial program 99.5%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                    8. Step-by-step derivation
                      1. Applied rewrites98.9%

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

                      if 9.5999999999999997e-21 < F

                      1. Initial program 60.7%

                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in F around inf

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

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

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

                      Alternative 5: 98.2% accurate, 1.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -1.42:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-21}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (let* ((t_0 (* x (/ -1.0 (tan B)))))
                         (if (<= F -1.42)
                           (+ t_0 (/ -1.0 (sin B)))
                           (if (<= F 9.6e-21)
                             (+ t_0 (* (/ F (sin B)) (sqrt 0.5)))
                             (+ t_0 (/ 1.0 (sin B)))))))
                      double code(double F, double B, double x) {
                      	double t_0 = x * (-1.0 / tan(B));
                      	double tmp;
                      	if (F <= -1.42) {
                      		tmp = t_0 + (-1.0 / sin(B));
                      	} else if (F <= 9.6e-21) {
                      		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
                      	} else {
                      		tmp = t_0 + (1.0 / sin(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) :: t_0
                          real(8) :: tmp
                          t_0 = x * ((-1.0d0) / tan(b))
                          if (f <= (-1.42d0)) then
                              tmp = t_0 + ((-1.0d0) / sin(b))
                          else if (f <= 9.6d-21) then
                              tmp = t_0 + ((f / sin(b)) * sqrt(0.5d0))
                          else
                              tmp = t_0 + (1.0d0 / sin(b))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double F, double B, double x) {
                      	double t_0 = x * (-1.0 / Math.tan(B));
                      	double tmp;
                      	if (F <= -1.42) {
                      		tmp = t_0 + (-1.0 / Math.sin(B));
                      	} else if (F <= 9.6e-21) {
                      		tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt(0.5));
                      	} else {
                      		tmp = t_0 + (1.0 / Math.sin(B));
                      	}
                      	return tmp;
                      }
                      
                      def code(F, B, x):
                      	t_0 = x * (-1.0 / math.tan(B))
                      	tmp = 0
                      	if F <= -1.42:
                      		tmp = t_0 + (-1.0 / math.sin(B))
                      	elif F <= 9.6e-21:
                      		tmp = t_0 + ((F / math.sin(B)) * math.sqrt(0.5))
                      	else:
                      		tmp = t_0 + (1.0 / math.sin(B))
                      	return tmp
                      
                      function code(F, B, x)
                      	t_0 = Float64(x * Float64(-1.0 / tan(B)))
                      	tmp = 0.0
                      	if (F <= -1.42)
                      		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
                      	elseif (F <= 9.6e-21)
                      		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(0.5)));
                      	else
                      		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(F, B, x)
                      	t_0 = x * (-1.0 / tan(B));
                      	tmp = 0.0;
                      	if (F <= -1.42)
                      		tmp = t_0 + (-1.0 / sin(B));
                      	elseif (F <= 9.6e-21)
                      		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
                      	else
                      		tmp = t_0 + (1.0 / sin(B));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.6e-21], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := x \cdot \frac{-1}{\tan B}\\
                      \mathbf{if}\;F \leq -1.42:\\
                      \;\;\;\;t\_0 + \frac{-1}{\sin B}\\
                      
                      \mathbf{elif}\;F \leq 9.6 \cdot 10^{-21}:\\
                      \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_0 + \frac{1}{\sin B}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if F < -1.4199999999999999

                        1. Initial program 63.3%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Add Preprocessing
                        3. Taylor expanded in F around -inf

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

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

                          if -1.4199999999999999 < F < 9.5999999999999997e-21

                          1. Initial program 99.5%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Add Preprocessing
                          3. Taylor expanded in x around 0

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2}} \]
                            3. Step-by-step derivation
                              1. Applied rewrites98.8%

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{0.5} \]

                              if 9.5999999999999997e-21 < F

                              1. Initial program 60.7%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Add Preprocessing
                              3. Taylor expanded in F around inf

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.42:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-21}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 6: 91.9% accurate, 1.4× speedup?

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

                                1. Initial program 61.7%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in F around -inf

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites99.7%

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

                                  if -1.28e20 < F < -1.3999999999999999e-128

                                  1. Initial program 99.6%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                                    if -1.3999999999999999e-128 < F < 9.5999999999999997e-21

                                    1. Initial program 99.5%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

                                      if 9.5999999999999997e-21 < F

                                      1. Initial program 60.7%

                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in F around inf

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

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

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

                                      Alternative 7: 91.9% accurate, 1.5× speedup?

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

                                        1. Initial program 61.7%

                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in F around -inf

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites99.7%

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

                                          if -1.28e20 < F < -1.3999999999999999e-128

                                          1. Initial program 99.6%

                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          2. Add Preprocessing
                                          3. Step-by-step derivation
                                            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                          8. Step-by-step derivation
                                            1. Applied rewrites90.8%

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

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

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

                                              if -1.3999999999999999e-128 < F < 9.5999999999999997e-21

                                              1. Initial program 99.5%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

                                                if 9.5999999999999997e-21 < F

                                                1. Initial program 60.7%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in F around inf

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

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

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

                                                Alternative 8: 91.9% accurate, 1.5× speedup?

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

                                                  1. Initial program 61.7%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in F around -inf

                                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites99.7%

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

                                                    if -1.28e20 < F < -1.3999999999999999e-128

                                                    1. Initial program 99.6%

                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    2. Add Preprocessing
                                                    3. Step-by-step derivation
                                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                                    8. Step-by-step derivation
                                                      1. Applied rewrites90.8%

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

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

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

                                                        if -1.3999999999999999e-128 < F < 9.5999999999999997e-21

                                                        1. Initial program 99.5%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

                                                          if 9.5999999999999997e-21 < F

                                                          1. Initial program 60.7%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Add Preprocessing
                                                          3. Step-by-step derivation
                                                            1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
                                                          8. Step-by-step derivation
                                                            1. Applied rewrites99.6%

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

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

                                                          Alternative 9: 91.9% accurate, 1.5× speedup?

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

                                                            1. Initial program 61.7%

                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in F around -inf

                                                              \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                            4. Step-by-step derivation
                                                              1. Applied rewrites99.7%

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

                                                              if -1.28e20 < F < -1.3999999999999999e-128

                                                              1. Initial program 99.6%

                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                              2. Add Preprocessing
                                                              3. Step-by-step derivation
                                                                1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                                              8. Step-by-step derivation
                                                                1. Applied rewrites90.8%

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

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

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

                                                                  if -1.3999999999999999e-128 < F < 9.5999999999999997e-21

                                                                  1. Initial program 99.5%

                                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

                                                                    if 9.5999999999999997e-21 < F

                                                                    1. Initial program 60.7%

                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                    2. Add Preprocessing
                                                                    3. Step-by-step derivation
                                                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
                                                                    8. Step-by-step derivation
                                                                      1. Applied rewrites99.6%

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

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

                                                                    Alternative 10: 84.8% accurate, 1.6× speedup?

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

                                                                      1. Initial program 61.7%

                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in F around -inf

                                                                        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites99.7%

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

                                                                        if -1.28e20 < F < -1.3999999999999999e-128

                                                                        1. Initial program 99.6%

                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                        2. Add Preprocessing
                                                                        3. Step-by-step derivation
                                                                          1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                                                        8. Step-by-step derivation
                                                                          1. Applied rewrites90.8%

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

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

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

                                                                            if -1.3999999999999999e-128 < F < 4.5999999999999998e-25

                                                                            1. Initial program 99.5%

                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

                                                                              if 4.5999999999999998e-25 < F

                                                                              1. Initial program 61.2%

                                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in B around 0

                                                                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                                                              4. Step-by-step derivation
                                                                                1. Applied rewrites53.9%

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

                                                                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites78.8%

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

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

                                                                                Alternative 11: 78.1% accurate, 2.0× speedup?

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

                                                                                  1. Initial program 82.1%

                                                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                  2. Add Preprocessing
                                                                                  3. Step-by-step derivation
                                                                                    1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

                                                                                    if -3.0999999999999999e-140 < x < 2.2000000000000001e-22

                                                                                    1. Initial program 72.1%

                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                    2. Add Preprocessing
                                                                                    3. Step-by-step derivation
                                                                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                                                                    8. Step-by-step derivation
                                                                                      1. Applied rewrites67.8%

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

                                                                                        \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B}, \frac{-x}{B}\right) \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites67.9%

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

                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.1 \cdot 10^{-140} \lor \neg \left(x \leq 2.2 \cdot 10^{-22}\right):\\ \;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}, \frac{-x}{B}\right)\\ \end{array} \]
                                                                                      6. Add Preprocessing

                                                                                      Alternative 12: 78.1% accurate, 2.2× speedup?

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

                                                                                        1. Initial program 82.1%

                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in B around 0

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

                                                                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
                                                                                          2. Step-by-step derivation
                                                                                            1. Applied rewrites93.4%

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

                                                                                            if -3.0999999999999999e-140 < x < 1.59999999999999991e-19

                                                                                            1. Initial program 72.1%

                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                            2. Add Preprocessing
                                                                                            3. Step-by-step derivation
                                                                                              1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                                                                            8. Step-by-step derivation
                                                                                              1. Applied rewrites67.8%

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

                                                                                                \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B}, \frac{-x}{B}\right) \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites67.9%

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

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

                                                                                              Alternative 13: 76.7% accurate, 2.2× speedup?

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

                                                                                                1. Initial program 74.9%

                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in B around 0

                                                                                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. Applied rewrites74.9%

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

                                                                                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites94.3%

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

                                                                                                    if -1.5499999999999999e-27 < x < 2.75e7

                                                                                                    1. Initial program 73.1%

                                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                    2. Add Preprocessing
                                                                                                    3. Step-by-step derivation
                                                                                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                      \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                                                                                                    8. Step-by-step derivation
                                                                                                      1. Applied rewrites65.4%

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

                                                                                                        \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B}, \frac{-x}{B}\right) \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites65.4%

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

                                                                                                        if 2.75e7 < x

                                                                                                        1. Initial program 87.8%

                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                        2. Add Preprocessing
                                                                                                        3. Taylor expanded in B around 0

                                                                                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                                                                                        4. Step-by-step derivation
                                                                                                          1. Applied rewrites87.8%

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

                                                                                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites99.7%

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

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

                                                                                                          Alternative 14: 69.2% accurate, 2.5× speedup?

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

                                                                                                            1. Initial program 81.8%

                                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                            2. Add Preprocessing
                                                                                                            3. Taylor expanded in B around 0

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

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

                                                                                                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
                                                                                                              3. Step-by-step derivation
                                                                                                                1. Applied rewrites88.5%

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

                                                                                                                if -5.3999999999999998e-132 < x < 1.15e-16

                                                                                                                1. Initial program 72.8%

                                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                2. Add Preprocessing
                                                                                                                3. Step-by-step derivation
                                                                                                                  1. lift-+.f64N/A

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

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

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

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

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

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

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

                                                                                                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                                                                                6. Step-by-step derivation
                                                                                                                  1. Applied rewrites51.3%

                                                                                                                    \[\leadsto \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}} \]
                                                                                                                  2. Step-by-step derivation
                                                                                                                    1. Applied rewrites57.7%

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

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

                                                                                                                  Alternative 15: 47.4% accurate, 2.6× speedup?

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

                                                                                                                    1. Initial program 74.3%

                                                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                    2. Add Preprocessing
                                                                                                                    3. Taylor expanded in B around 0

                                                                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                    4. Step-by-step derivation
                                                                                                                      1. Applied rewrites54.0%

                                                                                                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}} \]
                                                                                                                      2. Step-by-step derivation
                                                                                                                        1. Applied rewrites54.0%

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

                                                                                                                        if 1.85e24 < B < 1.25000000000000012e229

                                                                                                                        1. Initial program 87.3%

                                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Step-by-step derivation
                                                                                                                          1. lift-+.f64N/A

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

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

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

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

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

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

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

                                                                                                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                                                                                        6. Step-by-step derivation
                                                                                                                          1. Applied rewrites30.1%

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

                                                                                                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{\color{blue}{\sin B}} \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites19.6%

                                                                                                                              \[\leadsto \frac{\sqrt{0.5} \cdot F}{\color{blue}{\sin B}} \]

                                                                                                                            if 1.25000000000000012e229 < B

                                                                                                                            1. Initial program 92.0%

                                                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                            2. Add Preprocessing
                                                                                                                            3. Step-by-step derivation
                                                                                                                              1. lift-+.f64N/A

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

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

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

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

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

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

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

                                                                                                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                                                                                            6. Step-by-step derivation
                                                                                                                              1. Applied rewrites32.5%

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

                                                                                                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                                                                              3. Step-by-step derivation
                                                                                                                                1. Applied rewrites19.6%

                                                                                                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                                                                              4. Recombined 3 regimes into one program.
                                                                                                                              5. Final simplification45.5%

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

                                                                                                                              Alternative 16: 56.2% accurate, 2.7× speedup?

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

                                                                                                                                1. Initial program 74.0%

                                                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                2. Add Preprocessing
                                                                                                                                3. Taylor expanded in B around 0

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

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

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

                                                                                                                                    if 2.74999999999999989e-21 < B

                                                                                                                                    1. Initial program 87.2%

                                                                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                    2. Add Preprocessing
                                                                                                                                    3. Taylor expanded in B around 0

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

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

                                                                                                                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{B}} \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites57.0%

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

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

                                                                                                                                      Alternative 17: 47.1% accurate, 3.0× speedup?

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

                                                                                                                                        1. Initial program 74.6%

                                                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                        2. Add Preprocessing
                                                                                                                                        3. Taylor expanded in B around 0

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

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

                                                                                                                                        if 3.7e18 < B < 3.80000000000000014e216

                                                                                                                                        1. Initial program 84.5%

                                                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                        2. Add Preprocessing
                                                                                                                                        3. Step-by-step derivation
                                                                                                                                          1. lift-+.f64N/A

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

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

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

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

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

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

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

                                                                                                                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                                                                                                        6. Step-by-step derivation
                                                                                                                                          1. Applied rewrites27.6%

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

                                                                                                                                            \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                                                                                                                          3. Step-by-step derivation
                                                                                                                                            1. Applied rewrites21.4%

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

                                                                                                                                            if 3.80000000000000014e216 < B

                                                                                                                                            1. Initial program 94.0%

                                                                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                            2. Add Preprocessing
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. lift-+.f64N/A

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

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

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

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

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

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

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

                                                                                                                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                                                                                                            6. Step-by-step derivation
                                                                                                                                              1. Applied rewrites35.2%

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

                                                                                                                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                1. Applied rewrites15.5%

                                                                                                                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                                                                                              4. Recombined 3 regimes into one program.
                                                                                                                                              5. Final simplification45.3%

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

                                                                                                                                              Alternative 18: 47.3% accurate, 3.1× speedup?

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

                                                                                                                                                1. Initial program 74.4%

                                                                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                2. Add Preprocessing
                                                                                                                                                3. Taylor expanded in B around 0

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

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

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

                                                                                                                                                    if 8.2000000000000002e24 < B

                                                                                                                                                    1. Initial program 88.2%

                                                                                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                    2. Add Preprocessing
                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                      1. lift-+.f64N/A

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

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

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

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

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

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

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

                                                                                                                                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                                                                                                                    6. Step-by-step derivation
                                                                                                                                                      1. Applied rewrites29.5%

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

                                                                                                                                                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                        1. Applied rewrites12.4%

                                                                                                                                                          \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                                                                                                      4. Recombined 2 regimes into one program.
                                                                                                                                                      5. Final simplification43.7%

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

                                                                                                                                                      Alternative 19: 50.4% accurate, 6.0× speedup?

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

                                                                                                                                                        1. Initial program 64.8%

                                                                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                        3. Taylor expanded in B around 0

                                                                                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                          1. Applied rewrites36.5%

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

                                                                                                                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites41.8%

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

                                                                                                                                                            if -4.8999999999999999e-11 < F < 4.5999999999999998e-25

                                                                                                                                                            1. Initial program 99.5%

                                                                                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                            3. Taylor expanded in B around 0

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

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

                                                                                                                                                                \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites43.7%

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

                                                                                                                                                                if 4.5999999999999998e-25 < F

                                                                                                                                                                1. Initial program 61.2%

                                                                                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                3. Taylor expanded in B around 0

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

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

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

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

                                                                                                                                                                  Alternative 20: 50.6% accurate, 6.2× speedup?

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

                                                                                                                                                                    1. Initial program 64.8%

                                                                                                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                    2. Add Preprocessing
                                                                                                                                                                    3. Taylor expanded in B around 0

                                                                                                                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                                    4. Step-by-step derivation
                                                                                                                                                                      1. Applied rewrites36.5%

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

                                                                                                                                                                        \[\leadsto \frac{-1 - x}{B} \]
                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                        1. Applied rewrites41.8%

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

                                                                                                                                                                        if -4.8999999999999999e-11 < F < 4.5999999999999998e-25

                                                                                                                                                                        1. Initial program 99.5%

                                                                                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                        3. Taylor expanded in B around 0

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

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

                                                                                                                                                                            \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                            1. Applied rewrites43.7%

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

                                                                                                                                                                            if 4.5999999999999998e-25 < F

                                                                                                                                                                            1. Initial program 61.2%

                                                                                                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                            3. Taylor expanded in B around 0

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

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

                                                                                                                                                                                \[\leadsto \frac{1 - x}{B} \]
                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                1. Applied rewrites50.8%

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

                                                                                                                                                                              Alternative 21: 46.9% accurate, 6.2× speedup?

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

                                                                                                                                                                                1. Initial program 85.2%

                                                                                                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                3. Taylor expanded in B around 0

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

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

                                                                                                                                                                                  if 4.5999999999999998e-25 < F

                                                                                                                                                                                  1. Initial program 61.2%

                                                                                                                                                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                  2. Add Preprocessing
                                                                                                                                                                                  3. Taylor expanded in B around 0

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

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

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

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

                                                                                                                                                                                    Alternative 22: 46.9% accurate, 6.7× speedup?

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

                                                                                                                                                                                      1. Initial program 85.2%

                                                                                                                                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                      2. Add Preprocessing
                                                                                                                                                                                      3. Taylor expanded in B around 0

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

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

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

                                                                                                                                                                                          if 4.5999999999999998e-25 < F

                                                                                                                                                                                          1. Initial program 61.2%

                                                                                                                                                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                          3. Taylor expanded in B around 0

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

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

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

                                                                                                                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B} \]
                                                                                                                                                                                            4. Recombined 2 regimes into one program.
                                                                                                                                                                                            5. Final simplification43.9%

                                                                                                                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 4.6 \cdot 10^{-25}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \]
                                                                                                                                                                                            6. Add Preprocessing

                                                                                                                                                                                            Alternative 23: 50.6% accurate, 8.8× speedup?

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

                                                                                                                                                                                              1. Initial program 64.8%

                                                                                                                                                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                              2. Add Preprocessing
                                                                                                                                                                                              3. Taylor expanded in B around 0

                                                                                                                                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                                                                1. Applied rewrites36.5%

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

                                                                                                                                                                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                  1. Applied rewrites41.8%

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

                                                                                                                                                                                                  if -4.8999999999999999e-11 < F < 4.5999999999999998e-25

                                                                                                                                                                                                  1. Initial program 99.5%

                                                                                                                                                                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                  2. Add Preprocessing
                                                                                                                                                                                                  3. Taylor expanded in B around 0

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

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

                                                                                                                                                                                                      \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                      1. Applied rewrites43.7%

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

                                                                                                                                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2}}, F, -x\right)}{B} \]
                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                        1. Applied rewrites43.7%

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

                                                                                                                                                                                                        if 4.5999999999999998e-25 < F

                                                                                                                                                                                                        1. Initial program 61.2%

                                                                                                                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                        3. Taylor expanded in B around 0

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

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

                                                                                                                                                                                                            \[\leadsto \frac{1 - x}{B} \]
                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                            1. Applied rewrites50.8%

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

                                                                                                                                                                                                          Alternative 24: 43.0% accurate, 13.6× speedup?

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

                                                                                                                                                                                                            1. Initial program 64.8%

                                                                                                                                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                                                            3. Taylor expanded in B around 0

                                                                                                                                                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                                                                            4. Step-by-step derivation
                                                                                                                                                                                                              1. Applied rewrites36.5%

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

                                                                                                                                                                                                                \[\leadsto \frac{-1 - x}{B} \]
                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                1. Applied rewrites41.8%

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

                                                                                                                                                                                                                if -2.1999999999999998e-19 < F < 1.7999999999999999e-168

                                                                                                                                                                                                                1. Initial program 99.5%

                                                                                                                                                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                3. Taylor expanded in B around 0

                                                                                                                                                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                  1. Applied rewrites46.9%

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

                                                                                                                                                                                                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                    1. Applied rewrites35.3%

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

                                                                                                                                                                                                                    if 1.7999999999999999e-168 < F

                                                                                                                                                                                                                    1. Initial program 69.2%

                                                                                                                                                                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                                    2. Add Preprocessing
                                                                                                                                                                                                                    3. Taylor expanded in B around 0

                                                                                                                                                                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                                                                                    4. Step-by-step derivation
                                                                                                                                                                                                                      1. Applied rewrites40.9%

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

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

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

                                                                                                                                                                                                                      Alternative 25: 36.7% accurate, 17.5× speedup?

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

                                                                                                                                                                                                                        1. Initial program 64.8%

                                                                                                                                                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                        3. Taylor expanded in B around 0

                                                                                                                                                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                          1. Applied rewrites36.5%

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

                                                                                                                                                                                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                            1. Applied rewrites41.8%

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

                                                                                                                                                                                                                            if -2.1999999999999998e-19 < F

                                                                                                                                                                                                                            1. Initial program 82.9%

                                                                                                                                                                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                                                                            3. Taylor expanded in B around 0

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

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

                                                                                                                                                                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                1. Applied rewrites31.2%

                                                                                                                                                                                                                                  \[\leadsto \frac{-x}{B} \]
                                                                                                                                                                                                                              4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                              5. Add Preprocessing

                                                                                                                                                                                                                              Alternative 26: 29.3% accurate, 26.3× speedup?

                                                                                                                                                                                                                              \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                                                                                                                                                                                              (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                                                                                                                                                                                              double code(double F, double B, double x) {
                                                                                                                                                                                                                              	return -x / B;
                                                                                                                                                                                                                              }
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              module fmin_fmax_functions
                                                                                                                                                                                                                                  implicit none
                                                                                                                                                                                                                                  private
                                                                                                                                                                                                                                  public fmax
                                                                                                                                                                                                                                  public fmin
                                                                                                                                                                                                                              
                                                                                                                                                                                                                                  interface fmax
                                                                                                                                                                                                                                      module procedure fmax88
                                                                                                                                                                                                                                      module procedure fmax44
                                                                                                                                                                                                                                      module procedure fmax84
                                                                                                                                                                                                                                      module procedure fmax48
                                                                                                                                                                                                                                  end interface
                                                                                                                                                                                                                                  interface fmin
                                                                                                                                                                                                                                      module procedure fmin88
                                                                                                                                                                                                                                      module procedure fmin44
                                                                                                                                                                                                                                      module procedure fmin84
                                                                                                                                                                                                                                      module procedure fmin48
                                                                                                                                                                                                                                  end interface
                                                                                                                                                                                                                              contains
                                                                                                                                                                                                                                  real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                                                                      real(8), intent (in) :: x
                                                                                                                                                                                                                                      real(4), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                  real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                                                                      real(4), intent (in) :: x
                                                                                                                                                                                                                                      real(8), intent (in) :: y
                                                                                                                                                                                                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                              end module
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              real(8) function code(f, b, x)
                                                                                                                                                                                                                              use fmin_fmax_functions
                                                                                                                                                                                                                                  real(8), intent (in) :: f
                                                                                                                                                                                                                                  real(8), intent (in) :: b
                                                                                                                                                                                                                                  real(8), intent (in) :: x
                                                                                                                                                                                                                                  code = -x / b
                                                                                                                                                                                                                              end function
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              public static double code(double F, double B, double x) {
                                                                                                                                                                                                                              	return -x / B;
                                                                                                                                                                                                                              }
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              def code(F, B, x):
                                                                                                                                                                                                                              	return -x / B
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              function code(F, B, x)
                                                                                                                                                                                                                              	return Float64(Float64(-x) / B)
                                                                                                                                                                                                                              end
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              function tmp = code(F, B, x)
                                                                                                                                                                                                                              	tmp = -x / B;
                                                                                                                                                                                                                              end
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              \\
                                                                                                                                                                                                                              \frac{-x}{B}
                                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                                              
                                                                                                                                                                                                                              Derivation
                                                                                                                                                                                                                              1. Initial program 77.8%

                                                                                                                                                                                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                                                                                                                                                              2. Add Preprocessing
                                                                                                                                                                                                                              3. Taylor expanded in B around 0

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

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

                                                                                                                                                                                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                  1. Applied rewrites29.0%

                                                                                                                                                                                                                                    \[\leadsto \frac{-x}{B} \]
                                                                                                                                                                                                                                  2. Add Preprocessing

                                                                                                                                                                                                                                  Reproduce

                                                                                                                                                                                                                                  ?
                                                                                                                                                                                                                                  herbie shell --seed 2025019 
                                                                                                                                                                                                                                  (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))))))