VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.4% → 99.6%
Time: 9.2s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 76.4% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+113}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 880000:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B))))
   (if (<= F -1e+113)
     (/ (- (fma (cos B) x 1.0)) (sin B))
     (if (<= F 880000.0)
       (fma F (/ (/ 1.0 (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) t_0)
       (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double tmp;
	if (F <= -1e+113) {
		tmp = -fma(cos(B), x, 1.0) / sin(B);
	} else if (F <= 880000.0) {
		tmp = fma(F, ((1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), t_0);
	} else {
		tmp = t_0 + (1.0 / sin(B));
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	tmp = 0.0
	if (F <= -1e+113)
		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
	elseif (F <= 880000.0)
		tmp = fma(F, Float64(Float64(1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), t_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[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+113], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 880000.0], 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] + t$95$0), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+113}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\

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

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


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

    1. Initial program 38.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -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 -1e113 < F < 8.8e5

      1. Initial program 98.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 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.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.f6499.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 rewrites99.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) \]

      if 8.8e5 < F

      1. Initial program 54.0%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in F around 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}} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+113}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 880000:\\ \;\;\;\;\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}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
      7. Add Preprocessing

      Alternative 2: 99.6% accurate, 1.4× speedup?

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

        1. Initial program 51.0%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in F around -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 -1e10 < F < 8.8e5

          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. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 8.8e5 < F

          1. Initial program 54.0%

            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in F around 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}} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

          Alternative 3: 99.0% accurate, 1.4× speedup?

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

            1. Initial program 51.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 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.8%

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

              if -3.35000000000000009 < F < 1.30000000000000004

              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. 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}}} \]
              6. Applied rewrites98.2%

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

              if 1.30000000000000004 < F

              1. Initial program 55.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.1%

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

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

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

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

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

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

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

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

              Alternative 4: 92.0% accurate, 1.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -128000000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\ \;\;\;\;t\_0 + \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) (tan B))))
                 (if (<= F -128000000000.0)
                   (/ (- (fma (cos B) x 1.0)) (sin B))
                   (if (<= F -4.4e-164)
                     (fma F (/ (/ 1.0 (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ (- x) B))
                     (if (<= F 5e-10)
                       (+ t_0 (* (/ 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 / tan(B);
              	double tmp;
              	if (F <= -128000000000.0) {
              		tmp = -fma(cos(B), x, 1.0) / sin(B);
              	} else if (F <= -4.4e-164) {
              		tmp = fma(F, ((1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), (-x / B));
              	} else if (F <= 5e-10) {
              		tmp = t_0 + ((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(Float64(-x) / tan(B))
              	tmp = 0.0
              	if (F <= -128000000000.0)
              		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
              	elseif (F <= -4.4e-164)
              		tmp = fma(F, Float64(Float64(1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), Float64(Float64(-x) / B));
              	elseif (F <= 5e-10)
              		tmp = Float64(t_0 + 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[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -128000000000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.4e-164], 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) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-10], N[(t$95$0 + 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 := \frac{-x}{\tan B}\\
              \mathbf{if}\;F \leq -128000000000:\\
              \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
              
              \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\
              \;\;\;\;\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}{B}\right)\\
              
              \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\
              \;\;\;\;t\_0 + \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.28e11

                1. Initial program 49.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 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.28e11 < F < -4.39999999999999975e-164

                  1. Initial program 99.4%

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

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

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

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

                      \[\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.6

                      \[\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.6%

                    \[\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}, \frac{-x}{\color{blue}{B}}\right) \]
                  8. Step-by-step derivation
                    1. Applied rewrites88.1%

                      \[\leadsto \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}{\color{blue}{B}}\right) \]

                    if -4.39999999999999975e-164 < F < 5.00000000000000031e-10

                    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 rewrites91.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-*.f64N/A

                          \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\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(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \]
                        3. associate-*r/N/A

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

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

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

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

                      if 5.00000000000000031e-10 < F

                      1. Initial program 56.4%

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

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

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

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

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

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

                            \[\leadsto \left(-\frac{\color{blue}{x}}{\tan B}\right) + \frac{1}{\sin B} \]
                          5. lower-/.f6496.8

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -128000000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\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{-x}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 5: 92.0% accurate, 1.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -128000000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\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(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (if (<= F -128000000000.0)
                         (/ (- (fma (cos B) x 1.0)) (sin B))
                         (if (<= F -4.4e-164)
                           (fma F (/ (/ 1.0 (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ (- x) B))
                           (if (<= F 5e-10)
                             (+
                              (/ (- x) (tan B))
                              (* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
                             (/ (fma -1.0 (* (cos B) x) 1.0) (sin B))))))
                      double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -128000000000.0) {
                      		tmp = -fma(cos(B), x, 1.0) / sin(B);
                      	} else if (F <= -4.4e-164) {
                      		tmp = fma(F, ((1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), (-x / B));
                      	} else if (F <= 5e-10) {
                      		tmp = (-x / tan(B)) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
                      	} else {
                      		tmp = fma(-1.0, (cos(B) * x), 1.0) / sin(B);
                      	}
                      	return tmp;
                      }
                      
                      function code(F, B, x)
                      	tmp = 0.0
                      	if (F <= -128000000000.0)
                      		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
                      	elseif (F <= -4.4e-164)
                      		tmp = fma(F, Float64(Float64(1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), Float64(Float64(-x) / B));
                      	elseif (F <= 5e-10)
                      		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(-1.0, Float64(cos(B) * x), 1.0) / sin(B));
                      	end
                      	return tmp
                      end
                      
                      code[F_, B_, x_] := If[LessEqual[F, -128000000000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.4e-164], 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) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-10], 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[(-1.0 * N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;F \leq -128000000000:\\
                      \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
                      
                      \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\
                      \;\;\;\;\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}{B}\right)\\
                      
                      \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\
                      \;\;\;\;\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(-1, \cos B \cdot x, 1\right)}{\sin B}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if F < -1.28e11

                        1. Initial program 49.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 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.28e11 < F < -4.39999999999999975e-164

                          1. Initial program 99.4%

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

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

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

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

                              \[\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.6

                              \[\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.6%

                            \[\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}, \frac{-x}{\color{blue}{B}}\right) \]
                          8. Step-by-step derivation
                            1. Applied rewrites88.1%

                              \[\leadsto \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}{\color{blue}{B}}\right) \]

                            if -4.39999999999999975e-164 < F < 5.00000000000000031e-10

                            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 rewrites91.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-*.f64N/A

                                  \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\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(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \]
                                3. associate-*r/N/A

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

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

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

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

                              if 5.00000000000000031e-10 < F

                              1. Initial program 56.4%

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

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

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

                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                4. 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 rewrites73.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. Taylor expanded in F around inf

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -128000000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\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(-1, \cos B \cdot x, 1\right)}{\sin B}\\ \end{array} \]
                              9. Add Preprocessing

                              Alternative 6: 85.8% accurate, 1.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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}{B}\right)\\ \mathbf{if}\;F \leq -128000000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\ \;\;\;\;\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{elif}\;F \leq 4.3 \cdot 10^{+92}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
                              (FPCore (F B x)
                               :precision binary64
                               (let* ((t_0
                                       (fma
                                        F
                                        (/ (/ 1.0 (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B))
                                        (/ (- x) B))))
                                 (if (<= F -128000000000.0)
                                   (/ (- (fma (cos B) x 1.0)) (sin B))
                                   (if (<= F -4.4e-164)
                                     t_0
                                     (if (<= F 3.2e-32)
                                       (+
                                        (/ (- x) (tan B))
                                        (* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
                                       (if (<= F 4.3e+92) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))))
                              double code(double F, double B, double x) {
                              	double t_0 = fma(F, ((1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), (-x / B));
                              	double tmp;
                              	if (F <= -128000000000.0) {
                              		tmp = -fma(cos(B), x, 1.0) / sin(B);
                              	} else if (F <= -4.4e-164) {
                              		tmp = t_0;
                              	} else if (F <= 3.2e-32) {
                              		tmp = (-x / tan(B)) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
                              	} else if (F <= 4.3e+92) {
                              		tmp = t_0;
                              	} else {
                              		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	t_0 = fma(F, Float64(Float64(1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), Float64(Float64(-x) / B))
                              	tmp = 0.0
                              	if (F <= -128000000000.0)
                              		tmp = Float64(Float64(-fma(cos(B), x, 1.0)) / sin(B));
                              	elseif (F <= -4.4e-164)
                              		tmp = t_0;
                              	elseif (F <= 3.2e-32)
                              		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0))))));
                              	elseif (F <= 4.3e+92)
                              		tmp = t_0;
                              	else
                              		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := Block[{t$95$0 = 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) / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -128000000000.0], N[((-N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.4e-164], t$95$0, If[LessEqual[F, 3.2e-32], 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], If[LessEqual[F, 4.3e+92], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := \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}{B}\right)\\
                              \mathbf{if}\;F \leq -128000000000:\\
                              \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\
                              
                              \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\
                              \;\;\;\;\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{elif}\;F \leq 4.3 \cdot 10^{+92}:\\
                              \;\;\;\;t\_0\\
                              
                              \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.28e11

                                1. Initial program 49.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 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.28e11 < F < -4.39999999999999975e-164 or 3.2000000000000002e-32 < F < 4.2999999999999998e92

                                  1. Initial program 96.4%

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

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

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

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                    4. 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.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.f6499.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 rewrites99.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 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}, \frac{-x}{\color{blue}{B}}\right) \]
                                  8. Step-by-step derivation
                                    1. Applied rewrites90.1%

                                      \[\leadsto \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}{\color{blue}{B}}\right) \]

                                    if -4.39999999999999975e-164 < F < 3.2000000000000002e-32

                                    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. 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 rewrites92.0%

                                        \[\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-*.f64N/A

                                          \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\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(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \]
                                        3. associate-*r/N/A

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

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

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

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

                                      if 4.2999999999999998e92 < F

                                      1. Initial program 42.0%

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

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

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

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -128000000000:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\ \;\;\;\;\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{elif}\;F \leq 4.3 \cdot 10^{+92}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
                                        6. Add Preprocessing

                                        Alternative 7: 80.2% accurate, 2.0× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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}{B}\right)\\ \mathbf{if}\;F \leq -1.45 \cdot 10^{+14}:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\ \;\;\;\;\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{elif}\;F \leq 4.3 \cdot 10^{+92}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (let* ((t_0
                                                 (fma
                                                  F
                                                  (/ (/ 1.0 (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B))
                                                  (/ (- x) B))))
                                           (if (<= F -1.45e+14)
                                             (/ (- x -1.0) (- (sin B)))
                                             (if (<= F -4.4e-164)
                                               t_0
                                               (if (<= F 3.2e-32)
                                                 (+
                                                  (/ (- x) (tan B))
                                                  (* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
                                                 (if (<= F 4.3e+92) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))))
                                        double code(double F, double B, double x) {
                                        	double t_0 = fma(F, ((1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), (-x / B));
                                        	double tmp;
                                        	if (F <= -1.45e+14) {
                                        		tmp = (x - -1.0) / -sin(B);
                                        	} else if (F <= -4.4e-164) {
                                        		tmp = t_0;
                                        	} else if (F <= 3.2e-32) {
                                        		tmp = (-x / tan(B)) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
                                        	} else if (F <= 4.3e+92) {
                                        		tmp = t_0;
                                        	} else {
                                        		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(F, B, x)
                                        	t_0 = fma(F, Float64(Float64(1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), Float64(Float64(-x) / B))
                                        	tmp = 0.0
                                        	if (F <= -1.45e+14)
                                        		tmp = Float64(Float64(x - -1.0) / Float64(-sin(B)));
                                        	elseif (F <= -4.4e-164)
                                        		tmp = t_0;
                                        	elseif (F <= 3.2e-32)
                                        		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0))))));
                                        	elseif (F <= 4.3e+92)
                                        		tmp = t_0;
                                        	else
                                        		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[F_, B_, x_] := Block[{t$95$0 = 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) / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45e+14], N[(N[(x - -1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, -4.4e-164], t$95$0, If[LessEqual[F, 3.2e-32], 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], If[LessEqual[F, 4.3e+92], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_0 := \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}{B}\right)\\
                                        \mathbf{if}\;F \leq -1.45 \cdot 10^{+14}:\\
                                        \;\;\;\;\frac{x - -1}{-\sin B}\\
                                        
                                        \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\
                                        \;\;\;\;t\_0\\
                                        
                                        \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\
                                        \;\;\;\;\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{elif}\;F \leq 4.3 \cdot 10^{+92}:\\
                                        \;\;\;\;t\_0\\
                                        
                                        \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.45e14

                                          1. Initial program 49.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 rewrites40.1%

                                              \[\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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites99.7%

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

                                                \[\leadsto -\frac{1 + x}{\sin B} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites82.5%

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

                                                if -1.45e14 < F < -4.39999999999999975e-164 or 3.2000000000000002e-32 < F < 4.2999999999999998e92

                                                1. Initial program 96.4%

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

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

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

                                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                  4. 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.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.f6499.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 rewrites99.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 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}, \frac{-x}{\color{blue}{B}}\right) \]
                                                8. Step-by-step derivation
                                                  1. Applied rewrites90.1%

                                                    \[\leadsto \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}{\color{blue}{B}}\right) \]

                                                  if -4.39999999999999975e-164 < F < 3.2000000000000002e-32

                                                  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. 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 rewrites92.0%

                                                      \[\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-*.f64N/A

                                                        \[\leadsto \left(-\color{blue}{x \cdot \frac{1}{\tan B}}\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(-x \cdot \color{blue}{\frac{1}{\tan B}}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \]
                                                      3. associate-*r/N/A

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

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

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

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

                                                    if 4.2999999999999998e92 < F

                                                    1. Initial program 42.0%

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

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

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

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{+14}:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\ \;\;\;\;\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{elif}\;F \leq 4.3 \cdot 10^{+92}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
                                                      6. Add Preprocessing

                                                      Alternative 8: 80.2% accurate, 2.0× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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}{B}\right)\\ \mathbf{if}\;F \leq -1.45 \cdot 10^{+14}:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+92}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
                                                      (FPCore (F B x)
                                                       :precision binary64
                                                       (let* ((t_0
                                                               (fma
                                                                F
                                                                (/ (/ 1.0 (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B))
                                                                (/ (- x) B))))
                                                         (if (<= F -1.45e+14)
                                                           (/ (- x -1.0) (- (sin B)))
                                                           (if (<= F -4.4e-164)
                                                             t_0
                                                             (if (<= F 3.2e-32)
                                                               (- (/ (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) B) (/ x (tan B)))
                                                               (if (<= F 4.3e+92) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))))
                                                      double code(double F, double B, double x) {
                                                      	double t_0 = fma(F, ((1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), (-x / B));
                                                      	double tmp;
                                                      	if (F <= -1.45e+14) {
                                                      		tmp = (x - -1.0) / -sin(B);
                                                      	} else if (F <= -4.4e-164) {
                                                      		tmp = t_0;
                                                      	} else if (F <= 3.2e-32) {
                                                      		tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) / B) - (x / tan(B));
                                                      	} else if (F <= 4.3e+92) {
                                                      		tmp = t_0;
                                                      	} else {
                                                      		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      function code(F, B, x)
                                                      	t_0 = fma(F, Float64(Float64(1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)), Float64(Float64(-x) / B))
                                                      	tmp = 0.0
                                                      	if (F <= -1.45e+14)
                                                      		tmp = Float64(Float64(x - -1.0) / Float64(-sin(B)));
                                                      	elseif (F <= -4.4e-164)
                                                      		tmp = t_0;
                                                      	elseif (F <= 3.2e-32)
                                                      		tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) / B) - Float64(x / tan(B)));
                                                      	elseif (F <= 4.3e+92)
                                                      		tmp = t_0;
                                                      	else
                                                      		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      code[F_, B_, x_] := Block[{t$95$0 = 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) / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45e+14], N[(N[(x - -1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, -4.4e-164], t$95$0, If[LessEqual[F, 3.2e-32], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.3e+92], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      t_0 := \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}{B}\right)\\
                                                      \mathbf{if}\;F \leq -1.45 \cdot 10^{+14}:\\
                                                      \;\;\;\;\frac{x - -1}{-\sin B}\\
                                                      
                                                      \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\
                                                      \;\;\;\;t\_0\\
                                                      
                                                      \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\
                                                      \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{x}{\tan B}\\
                                                      
                                                      \mathbf{elif}\;F \leq 4.3 \cdot 10^{+92}:\\
                                                      \;\;\;\;t\_0\\
                                                      
                                                      \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.45e14

                                                        1. Initial program 49.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 rewrites40.1%

                                                            \[\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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites99.7%

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

                                                              \[\leadsto -\frac{1 + x}{\sin B} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites82.5%

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

                                                              if -1.45e14 < F < -4.39999999999999975e-164 or 3.2000000000000002e-32 < F < 4.2999999999999998e92

                                                              1. Initial program 96.4%

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

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

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

                                                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                4. 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.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.f6499.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 rewrites99.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 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}, \frac{-x}{\color{blue}{B}}\right) \]
                                                              8. Step-by-step derivation
                                                                1. Applied rewrites90.1%

                                                                  \[\leadsto \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}{\color{blue}{B}}\right) \]

                                                                if -4.39999999999999975e-164 < F < 3.2000000000000002e-32

                                                                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. 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 rewrites92.0%

                                                                    \[\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-/.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                                  if 4.2999999999999998e92 < F

                                                                  1. Initial program 42.0%

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

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

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

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{+14}:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-164}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-32}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+92}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
                                                                    6. Add Preprocessing

                                                                    Alternative 9: 77.8% accurate, 2.1× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+79}:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
                                                                    (FPCore (F B x)
                                                                     :precision binary64
                                                                     (if (<= F -2.9e+79)
                                                                       (/ (- x -1.0) (- (sin B)))
                                                                       (if (<= F 1.05e-6)
                                                                         (fma F (/ (/ 1.0 (sqrt (fma x 2.0 (fma F F 2.0)))) B) (/ (- x) (tan B)))
                                                                         (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
                                                                    double code(double F, double B, double x) {
                                                                    	double tmp;
                                                                    	if (F <= -2.9e+79) {
                                                                    		tmp = (x - -1.0) / -sin(B);
                                                                    	} else if (F <= 1.05e-6) {
                                                                    		tmp = fma(F, ((1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / B), (-x / tan(B)));
                                                                    	} else {
                                                                    		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    function code(F, B, x)
                                                                    	tmp = 0.0
                                                                    	if (F <= -2.9e+79)
                                                                    		tmp = Float64(Float64(x - -1.0) / Float64(-sin(B)));
                                                                    	elseif (F <= 1.05e-6)
                                                                    		tmp = fma(F, Float64(Float64(1.0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / B), Float64(Float64(-x) / tan(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[F, -2.9e+79], N[(N[(x - -1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.05e-6], N[(F * N[(N[(1.0 / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    \mathbf{if}\;F \leq -2.9 \cdot 10^{+79}:\\
                                                                    \;\;\;\;\frac{x - -1}{-\sin B}\\
                                                                    
                                                                    \mathbf{elif}\;F \leq 1.05 \cdot 10^{-6}:\\
                                                                    \;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B}, \frac{-x}{\tan B}\right)\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 3 regimes
                                                                    2. if F < -2.89999999999999992e79

                                                                      1. Initial program 42.6%

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

                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites34.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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites99.8%

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

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

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

                                                                            if -2.89999999999999992e79 < F < 1.0499999999999999e-6

                                                                            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.6

                                                                                \[\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.6

                                                                                \[\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.6%

                                                                              \[\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)}}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
                                                                            8. Step-by-step derivation
                                                                              1. Applied rewrites85.5%

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

                                                                              if 1.0499999999999999e-6 < F

                                                                              1. Initial program 55.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 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 rewrites97.9%

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

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

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

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

                                                                                Alternative 10: 77.9% accurate, 2.2× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+79}:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+107}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
                                                                                (FPCore (F B x)
                                                                                 :precision binary64
                                                                                 (if (<= F -2.9e+79)
                                                                                   (/ (- x -1.0) (- (sin B)))
                                                                                   (if (<= F 5e+107)
                                                                                     (- (/ (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) B) (/ x (tan B)))
                                                                                     (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
                                                                                double code(double F, double B, double x) {
                                                                                	double tmp;
                                                                                	if (F <= -2.9e+79) {
                                                                                		tmp = (x - -1.0) / -sin(B);
                                                                                	} else if (F <= 5e+107) {
                                                                                		tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) / B) - (x / tan(B));
                                                                                	} else {
                                                                                		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                function code(F, B, x)
                                                                                	tmp = 0.0
                                                                                	if (F <= -2.9e+79)
                                                                                		tmp = Float64(Float64(x - -1.0) / Float64(-sin(B)));
                                                                                	elseif (F <= 5e+107)
                                                                                		tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) / B) - Float64(x / tan(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[F, -2.9e+79], N[(N[(x - -1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5e+107], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;F \leq -2.9 \cdot 10^{+79}:\\
                                                                                \;\;\;\;\frac{x - -1}{-\sin B}\\
                                                                                
                                                                                \mathbf{elif}\;F \leq 5 \cdot 10^{+107}:\\
                                                                                \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{x}{\tan B}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 3 regimes
                                                                                2. if F < -2.89999999999999992e79

                                                                                  1. Initial program 42.6%

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

                                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. Applied rewrites34.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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites99.8%

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

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

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

                                                                                        if -2.89999999999999992e79 < F < 5.0000000000000002e107

                                                                                        1. Initial program 97.6%

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

                                                                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. Applied rewrites81.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. Step-by-step derivation
                                                                                            1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                                                          if 5.0000000000000002e107 < F

                                                                                          1. Initial program 39.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.7%

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

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

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

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

                                                                                            Alternative 11: 55.5% accurate, 2.4× speedup?

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

                                                                                              1. Initial program 70.8%

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

                                                                                                \[\leadsto \color{blue}{\frac{\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 rewrites58.3%

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

                                                                                              if 0.048000000000000001 < B

                                                                                              1. Initial program 83.8%

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

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

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

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

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

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

                                                                                                Alternative 12: 65.6% accurate, 2.6× speedup?

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

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

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

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

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

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

                                                                                                        if -0.220000000000000001 < F < 5.00000000000000031e-10

                                                                                                        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 rewrites86.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. Taylor expanded in B around 0

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

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

                                                                                                            if 5.00000000000000031e-10 < F

                                                                                                            1. Initial program 56.4%

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

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

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

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

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

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

                                                                                                              Alternative 13: 54.8% accurate, 2.7× speedup?

                                                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.15:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right), \left(0.3333333333333333 \cdot \left(B \cdot B\right)\right) \cdot x\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 0.15)
                                                                                                                 (/
                                                                                                                  (-
                                                                                                                   (fma
                                                                                                                    (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))
                                                                                                                    (fma (* (* B B) F) 0.16666666666666666 F)
                                                                                                                    (* (* 0.3333333333333333 (* B B)) x))
                                                                                                                   x)
                                                                                                                  B)
                                                                                                                 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
                                                                                                              double code(double F, double B, double x) {
                                                                                                              	double tmp;
                                                                                                              	if (B <= 0.15) {
                                                                                                              		tmp = (fma(sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))), fma(((B * B) * F), 0.16666666666666666, F), ((0.3333333333333333 * (B * B)) * x)) - x) / B;
                                                                                                              	} else {
                                                                                                              		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
                                                                                                              	}
                                                                                                              	return tmp;
                                                                                                              }
                                                                                                              
                                                                                                              function code(F, B, x)
                                                                                                              	tmp = 0.0
                                                                                                              	if (B <= 0.15)
                                                                                                              		tmp = Float64(Float64(fma(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))), fma(Float64(Float64(B * B) * F), 0.16666666666666666, F), Float64(Float64(0.3333333333333333 * Float64(B * B)) * x)) - x) / B);
                                                                                                              	else
                                                                                                              		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
                                                                                                              	end
                                                                                                              	return tmp
                                                                                                              end
                                                                                                              
                                                                                                              code[F_, B_, x_] := If[LessEqual[B, 0.15], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.16666666666666666 + F), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] * x), $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 0.15:\\
                                                                                                              \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right), \left(0.3333333333333333 \cdot \left(B \cdot B\right)\right) \cdot x\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 < 0.149999999999999994

                                                                                                                1. Initial program 70.8%

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

                                                                                                                  \[\leadsto \color{blue}{\frac{\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 rewrites58.3%

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

                                                                                                                if 0.149999999999999994 < B

                                                                                                                1. Initial program 83.8%

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

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

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

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

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

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

                                                                                                                  Alternative 14: 57.9% accurate, 3.0× speedup?

                                                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.22:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\left(-\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, -0.3333333333333333, x\right)}{B}\right) + \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(\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 -0.22)
                                                                                                                     (/ (- x -1.0) (- (sin B)))
                                                                                                                     (if (<= F 5e-10)
                                                                                                                       (+
                                                                                                                        (- (/ (fma (* (* B B) x) -0.3333333333333333 x) B))
                                                                                                                        (* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0))))))
                                                                                                                       (/ (- (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 <= -0.22) {
                                                                                                                  		tmp = (x - -1.0) / -sin(B);
                                                                                                                  	} else if (F <= 5e-10) {
                                                                                                                  		tmp = -(fma(((B * B) * x), -0.3333333333333333, x) / B) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
                                                                                                                  	} 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 <= -0.22)
                                                                                                                  		tmp = Float64(Float64(x - -1.0) / Float64(-sin(B)));
                                                                                                                  	elseif (F <= 5e-10)
                                                                                                                  		tmp = Float64(Float64(-Float64(fma(Float64(Float64(B * B) * x), -0.3333333333333333, x) / B)) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0))))));
                                                                                                                  	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, -0.22], N[(N[(x - -1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5e-10], N[((-N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision] / B), $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[(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 -0.22:\\
                                                                                                                  \;\;\;\;\frac{x - -1}{-\sin B}\\
                                                                                                                  
                                                                                                                  \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\
                                                                                                                  \;\;\;\;\left(-\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, -0.3333333333333333, x\right)}{B}\right) + \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(\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 < -0.220000000000000001

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

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

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

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

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

                                                                                                                          if -0.220000000000000001 < F < 5.00000000000000031e-10

                                                                                                                          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 rewrites86.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. Taylor expanded in B around 0

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

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

                                                                                                                              if 5.00000000000000031e-10 < F

                                                                                                                              1. Initial program 56.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 rewrites39.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. 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 rewrites56.2%

                                                                                                                                    \[\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. Final simplification61.7%

                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.22:\\ \;\;\;\;\frac{x - -1}{-\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\left(-\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, -0.3333333333333333, x\right)}{B}\right) + \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(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\ \end{array} \]
                                                                                                                                6. Add Preprocessing

                                                                                                                                Alternative 15: 51.3% accurate, 3.1× speedup?

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

                                                                                                                                  1. Initial program 30.7%

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

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

                                                                                                                                      \[\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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                                                                                    3. Step-by-step derivation
                                                                                                                                      1. Applied rewrites99.7%

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

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

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

                                                                                                                                        if -6.6e134 < F < 4.2000000000000003e103

                                                                                                                                        1. Initial program 96.1%

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

                                                                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                        4. Step-by-step derivation
                                                                                                                                          1. Applied rewrites56.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}} \]

                                                                                                                                          if 4.2000000000000003e103 < F

                                                                                                                                          1. Initial program 39.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.7%

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

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

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

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

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

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

                                                                                                                                              Alternative 16: 50.4% accurate, 3.9× speedup?

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

                                                                                                                                                1. Initial program 42.6%

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

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

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

                                                                                                                                                    if -1.84999999999999997e77 < F < 5.00000000000000031e-10

                                                                                                                                                    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 rewrites86.0%

                                                                                                                                                        \[\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 B around 0

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

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

                                                                                                                                                        if 5.00000000000000031e-10 < F

                                                                                                                                                        1. Initial program 56.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 rewrites39.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. 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 rewrites56.2%

                                                                                                                                                              \[\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 17: 51.0% accurate, 5.7× speedup?

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

                                                                                                                                                            1. Initial program 47.1%

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

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

                                                                                                                                                                \[\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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites99.7%

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

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

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

                                                                                                                                                                  if -8.5999999999999994e38 < F < 4.2000000000000003e103

                                                                                                                                                                  1. Initial program 97.6%

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

                                                                                                                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                                                                                  4. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites54.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}} \]

                                                                                                                                                                    if 4.2000000000000003e103 < F

                                                                                                                                                                    1. Initial program 39.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.7%

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

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

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

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

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

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

                                                                                                                                                                        Alternative 18: 50.6% accurate, 6.2× speedup?

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

                                                                                                                                                                          1. Initial program 51.6%

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

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

                                                                                                                                                                              \[\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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                              1. Applied rewrites99.8%

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

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

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

                                                                                                                                                                                if -2.2000000000000002 < F < 4.9e8

                                                                                                                                                                                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 rewrites50.2%

                                                                                                                                                                                    \[\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{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]
                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                    1. Applied rewrites49.6%

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

                                                                                                                                                                                    if 4.9e8 < F

                                                                                                                                                                                    1. Initial program 52.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}} \]
                                                                                                                                                                                      2. Taylor expanded in B around 0

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

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

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

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

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

                                                                                                                                                                                        Alternative 19: 43.5% accurate, 7.2× speedup?

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

                                                                                                                                                                                          1. Initial program 53.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 rewrites41.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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                              1. Applied rewrites97.4%

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

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

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

                                                                                                                                                                                                if -1.9600000000000001e-7 < F < 4.9e8

                                                                                                                                                                                                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 rewrites50.2%

                                                                                                                                                                                                    \[\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 rewrites38.6%

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

                                                                                                                                                                                                    if 4.9e8 < F

                                                                                                                                                                                                    1. Initial program 52.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}} \]
                                                                                                                                                                                                      2. Taylor expanded in B around 0

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

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

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

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

                                                                                                                                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.96 \cdot 10^{-7}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, \mathsf{fma}\left(0.16666666666666666, x, 0.16666666666666666\right)\right), B \cdot B, x\right) - -1}{B}\\ \mathbf{elif}\;F \leq 490000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)}{B}\\ \end{array} \]
                                                                                                                                                                                                        6. Add Preprocessing

                                                                                                                                                                                                        Alternative 20: 43.5% accurate, 7.2× speedup?

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

                                                                                                                                                                                                          1. Initial program 53.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 rewrites41.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 rewrites57.1%

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

                                                                                                                                                                                                              if -1.9600000000000001e-7 < F < 4.9e8

                                                                                                                                                                                                              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 rewrites50.2%

                                                                                                                                                                                                                  \[\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 rewrites38.6%

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

                                                                                                                                                                                                                  if 4.9e8 < F

                                                                                                                                                                                                                  1. Initial program 52.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}} \]
                                                                                                                                                                                                                    2. Taylor expanded in B around 0

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

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

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

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

                                                                                                                                                                                                                      Alternative 21: 43.7% accurate, 13.6× speedup?

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

                                                                                                                                                                                                                        1. Initial program 54.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 rewrites42.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 -inf

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

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

                                                                                                                                                                                                                            if -3.7999999999999998e-21 < F < 1.1000000000000001e-6

                                                                                                                                                                                                                            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 rewrites50.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 0

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

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

                                                                                                                                                                                                                                if 1.1000000000000001e-6 < F

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

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

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

                                                                                                                                                                                                                                  Alternative 22: 35.9% accurate, 17.5× speedup?

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

                                                                                                                                                                                                                                    1. Initial program 53.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 rewrites41.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 rewrites57.1%

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

                                                                                                                                                                                                                                        if -1.9600000000000001e-7 < F

                                                                                                                                                                                                                                        1. Initial program 82.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 rewrites46.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 \frac{-1 \cdot x}{B} \]
                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                            1. Applied rewrites33.6%

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

                                                                                                                                                                                                                                          Alternative 23: 28.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 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 rewrites45.2%

                                                                                                                                                                                                                                              \[\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 rewrites33.3%

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

                                                                                                                                                                                                                                              Reproduce

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