VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.1% → 99.7%
Time: 7.1s
Alternatives: 27
Speedup: 2.1×

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}

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 27 alternatives:

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

Initial Program: 77.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{+38}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + {\sin B}^{-1}\\


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

    1. Initial program 53.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. 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. mul-1-negN/A

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

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

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

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

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

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      9. lift-sin.f6499.8

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    4. Applied rewrites99.8%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]

    if -2.49999999999999985e38 < F < 3.2e9

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e9 < F

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\sin B}^{-1} \]
    4. Applied rewrites99.7%

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

Alternative 2: 76.8% accurate, 0.3× 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)}}}{B}, \frac{-x}{\tan B}\right)\\ t_1 := \frac{F}{\sin B}\\ t_2 := \left(-x \cdot \frac{1}{\tan B}\right) + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{if}\;t\_2 \leq -200000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq 10:\\ \;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+300}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{2 + 2 \cdot x}{B \cdot \left(F \cdot F\right)}, {B}^{-1}\right) - \frac{x}{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)))) B)
          (/ (- x) (tan B))))
        (t_1 (/ F (sin B)))
        (t_2
         (+
          (- (* x (/ 1.0 (tan B))))
          (* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))))
   (if (<= t_2 -200000.0)
     t_0
     (if (<= t_2 10.0)
       (* (/ 1.0 (sqrt (fma F F 2.0))) t_1)
       (if (<= t_2 1e+300)
         t_0
         (-
          (fma -0.5 (/ (+ 2.0 (* 2.0 x)) (* B (* F F))) (pow B -1.0))
          (/ x 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)))) / B), (-x / tan(B)));
	double t_1 = F / sin(B);
	double t_2 = -(x * (1.0 / tan(B))) + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	double tmp;
	if (t_2 <= -200000.0) {
		tmp = t_0;
	} else if (t_2 <= 10.0) {
		tmp = (1.0 / sqrt(fma(F, F, 2.0))) * t_1;
	} else if (t_2 <= 1e+300) {
		tmp = t_0;
	} else {
		tmp = fma(-0.5, ((2.0 + (2.0 * x)) / (B * (F * F))), pow(B, -1.0)) - (x / 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)))) / B), Float64(Float64(-x) / tan(B)))
	t_1 = Float64(F / sin(B))
	t_2 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(t_1 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
	tmp = 0.0
	if (t_2 <= -200000.0)
		tmp = t_0;
	elseif (t_2 <= 10.0)
		tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * t_1);
	elseif (t_2 <= 1e+300)
		tmp = t_0;
	else
		tmp = Float64(fma(-0.5, Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(B * Float64(F * F))), (B ^ -1.0)) - Float64(x / 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] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(t$95$1 * 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]}, If[LessEqual[t$95$2, -200000.0], t$95$0, If[LessEqual[t$95$2, 10.0], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+300], t$95$0, N[(N[(-0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] - N[(x / 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)}}}{B}, \frac{-x}{\tan B}\right)\\
t_1 := \frac{F}{\sin B}\\
t_2 := \left(-x \cdot \frac{1}{\tan B}\right) + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{if}\;t\_2 \leq -200000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_2 \leq 10:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+300}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{2 + 2 \cdot x}{B \cdot \left(F \cdot F\right)}, {B}^{-1}\right) - \frac{x}{B}\\


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

    1. Initial program 96.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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\color{blue}{\sqrt{2 \cdot x + \left(F \cdot F + 2\right)}}}}{\sin B}, \frac{-x}{\tan B}\right) \]
    6. Applied rewrites98.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)}}}{\color{blue}{B}}, \frac{-x}{\tan B}\right) \]
    8. Step-by-step derivation
      1. Applied rewrites98.1%

        \[\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 -2e5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

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

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

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

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

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

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

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

          \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        7. pow2N/A

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

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

          \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        10. lift-/.f6448.1

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

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

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

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

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

          \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
        5. pow2N/A

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

          \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
        7. sqrt-divN/A

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

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

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

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

          \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
        12. pow2N/A

          \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
        13. lift-fma.f6448.0

          \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
      6. Applied rewrites48.0%

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

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

      1. Initial program 19.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. 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}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

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

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

        \[\leadsto \frac{1 - x}{B} \]
      6. Step-by-step derivation
        1. lower--.f6478.4

          \[\leadsto \frac{1 - x}{B} \]
      7. Applied rewrites78.4%

        \[\leadsto \frac{1 - x}{B} \]
      8. Taylor expanded in F around inf

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

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

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

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

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

    Alternative 3: 99.6% accurate, 1.1× speedup?

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

      1. Initial program 53.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. 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. mul-1-negN/A

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

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

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

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

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

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

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

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        9. lift-sin.f6499.8

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. Applied rewrites99.8%

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]

      if -2.49999999999999985e38 < F < 3.2e9

      1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.2e9 < F

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\sin B}^{-1} \]
      4. Applied rewrites99.7%

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

    Alternative 4: 99.6% accurate, 1.3× speedup?

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

      1. Initial program 53.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. 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. mul-1-negN/A

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

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

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

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

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

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

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

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        9. lift-sin.f6499.8

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. Applied rewrites99.8%

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]

      if -2.49999999999999985e38 < F < 9.99999999999999953e67

      1. Initial program 98.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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 9.99999999999999953e67 < F

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      3. Step-by-step derivation
        1. sub-divN/A

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

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

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

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

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        6. lower-cos.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        7. lift-sin.f6499.7

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      4. Applied rewrites99.7%

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

    Alternative 5: 98.1% accurate, 1.4× speedup?

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

      1. Initial program 58.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. 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. mul-1-negN/A

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

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

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

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

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

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

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

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        9. lift-sin.f6499.2

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
      4. Applied rewrites99.2%

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]

      if -1.44999999999999996 < F < 4.20000000000000016e-22

      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\color{blue}{\sqrt{2 \cdot x + \left(F \cdot F + 2\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 F around 0

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

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

        if 4.20000000000000016e-22 < F

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

          \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
        3. Step-by-step derivation
          1. sub-divN/A

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

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

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

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

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          6. lower-cos.f64N/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          7. lift-sin.f6495.4

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        4. Applied rewrites95.4%

          \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
      9. Recombined 3 regimes into one program.
      10. Add Preprocessing

      Alternative 6: 91.3% accurate, 1.4× speedup?

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

        1. Initial program 59.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. 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. mul-1-negN/A

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

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

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

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

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

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

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

            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
          9. lift-sin.f6496.7

            \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        4. Applied rewrites96.7%

          \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]

        if -7.0000000000000001e-15 < F < 4.20000000000000016e-22

        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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} \]
        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 B around 0

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

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

          if 4.20000000000000016e-22 < F

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

            \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
          3. Step-by-step derivation
            1. sub-divN/A

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

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

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

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

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
            6. lower-cos.f64N/A

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
            7. lift-sin.f6495.4

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
          4. Applied rewrites95.4%

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

        Alternative 7: 85.8% accurate, 1.5× speedup?

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
          4. Applied rewrites99.6%

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
          5. 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)}} \]
          6. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{-1}{6}, {B}^{2}, 1\right) \cdot B} \]
            5. unpow2N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right) \cdot B} \]
            6. lower-*.f6475.6

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
          7. Applied rewrites75.6%

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

          if -1.2800000000000001e154 < F < -1.4500000000000001e-22

          1. Initial program 90.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. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
          5. 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. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}}{\sin B}, \frac{-x}{\tan B}\right) \]
          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 rewrites79.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) \]

            if -1.4500000000000001e-22 < F < 4.20000000000000016e-22

            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. Step-by-step derivation
              1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\color{blue}{\sqrt{2 \cdot x + \left(F \cdot F + 2\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.2%

                \[\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 4.20000000000000016e-22 < F

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

                \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
              3. Step-by-step derivation
                1. sub-divN/A

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

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

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

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

                  \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                6. lower-cos.f64N/A

                  \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                7. lift-sin.f6495.4

                  \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
              4. Applied rewrites95.4%

                \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
            9. Recombined 4 regimes into one program.
            10. Add Preprocessing

            Alternative 8: 91.3% accurate, 1.6× speedup?

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

              1. Initial program 59.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. 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. mul-1-negN/A

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

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

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

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

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

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

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

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                9. lift-sin.f6496.7

                  \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
              4. Applied rewrites96.7%

                \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]

              if -7.0000000000000001e-15 < F < 4.20000000000000016e-22

              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. Step-by-step derivation
                1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\color{blue}{\sqrt{2 \cdot x + \left(F \cdot F + 2\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.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) \]

                if 4.20000000000000016e-22 < F

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

                  \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                3. Step-by-step derivation
                  1. sub-divN/A

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

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

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

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

                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                  6. lower-cos.f64N/A

                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                  7. lift-sin.f6495.4

                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                4. Applied rewrites95.4%

                  \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
              9. Recombined 3 regimes into one program.
              10. Add Preprocessing

              Alternative 9: 78.8% accurate, 2.1× speedup?

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

                1. Initial program 80.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. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\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 rewrites93.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 -3.1999999999999998e-48 < x < 1.20000000000000001e-27

                  1. Initial program 73.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. Step-by-step derivation
                    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(F, \frac{\frac{1}{\color{blue}{\sqrt{2 \cdot x + \left(F \cdot F + 2\right)}}}}{\sin B}, \frac{-x}{\tan B}\right) \]
                  6. Applied rewrites76.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 rewrites65.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) \]
                  9. Recombined 2 regimes into one program.
                  10. Add Preprocessing

                  Alternative 10: 69.4% accurate, 2.2× speedup?

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

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

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                    4. Applied rewrites76.1%

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

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\left(1 + {B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)\right) \cdot B} \]
                      3. +-commutativeN/A

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

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

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

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

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, {B}^{2}, 1\right) \cdot B} \]
                      10. unpow2N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, B \cdot B, 1\right) \cdot B} \]
                      11. lower-*.f6478.9

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                    7. Applied rewrites78.9%

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

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

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

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

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

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

                        \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, B \cdot B, 1\right) \cdot B} \]
                      7. lift-tan.f6479.0

                        \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                    9. Applied rewrites79.0%

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

                    if -3.3e-48 < x < 3.59999999999999966e-86

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

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

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

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

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

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

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

                        \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                      7. pow2N/A

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

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

                        \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                      10. lift-/.f6453.1

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

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

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

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

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

                        \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                      5. pow2N/A

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

                        \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                      7. sqrt-divN/A

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

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

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

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

                        \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                      12. pow2N/A

                        \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                      13. lift-fma.f6453.0

                        \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                    6. Applied rewrites53.0%

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

                    if 3.59999999999999966e-86 < x < 5.8e-5

                    1. Initial program 72.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. 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}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 5.8e-5 < x

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

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

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

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

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

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

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

                    Alternative 11: 69.4% accurate, 2.2× speedup?

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

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                      4. Applied rewrites76.1%

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\left(1 + {B}^{2} \cdot \left(\frac{1}{120} \cdot {B}^{2} - \frac{1}{6}\right)\right) \cdot B} \]
                        3. +-commutativeN/A

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

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

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

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, {B}^{2}, 1\right) \cdot B} \]
                        10. unpow2N/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, B \cdot B, 1\right) \cdot B} \]
                        11. lower-*.f6478.9

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                      7. Applied rewrites78.9%

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot {B}^{2}, B \cdot B, 1\right) \cdot B} \]
                      9. Step-by-step derivation
                        1. *-commutativeN/A

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left({B}^{2} \cdot \frac{1}{120}, B \cdot B, 1\right) \cdot B} \]
                        3. pow2N/A

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot \frac{1}{120}, B \cdot B, 1\right) \cdot B} \]
                        4. lift-*.f6478.9

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.008333333333333333, B \cdot B, 1\right) \cdot B} \]
                      10. Applied rewrites78.9%

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.008333333333333333, B \cdot B, 1\right) \cdot B} \]

                      if -3.3e-48 < x < 3.59999999999999966e-86

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

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

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

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

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

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

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

                          \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                        7. pow2N/A

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

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

                          \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                        10. lift-/.f6453.1

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

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

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

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

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

                          \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                        5. pow2N/A

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

                          \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                        7. sqrt-divN/A

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

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

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

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

                          \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                        12. pow2N/A

                          \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                        13. lift-fma.f6453.0

                          \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                      6. Applied rewrites53.0%

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

                      if 3.59999999999999966e-86 < x < 5.8e-5

                      1. Initial program 72.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. 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}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 5.8e-5 < x

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

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

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

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

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

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

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

                      Alternative 12: 69.4% accurate, 2.3× speedup?

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

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

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

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

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                        4. Applied rewrites76.1%

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                        5. 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)}} \]
                        6. Step-by-step derivation
                          1. *-commutativeN/A

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

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

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

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{-1}{6}, {B}^{2}, 1\right) \cdot B} \]
                          5. unpow2N/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right) \cdot B} \]
                          6. lower-*.f6478.8

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                        7. Applied rewrites78.8%

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

                        if -3.3e-48 < x < 3.59999999999999966e-86

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

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

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

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

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

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

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

                            \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                          7. pow2N/A

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

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

                            \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                          10. lift-/.f6453.1

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

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

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

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

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

                            \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                          5. pow2N/A

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

                            \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                          7. sqrt-divN/A

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

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

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

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

                            \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                          12. pow2N/A

                            \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                          13. lift-fma.f6453.0

                            \[\leadsto \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                        6. Applied rewrites53.0%

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

                        if 3.59999999999999966e-86 < x < 5.8e-5

                        1. Initial program 72.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. 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}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 5.8e-5 < x

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

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

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

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

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

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

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

                        Alternative 13: 69.2% accurate, 2.3× speedup?

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

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

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                          4. Applied rewrites95.0%

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

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

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

                            if -1.56000000000000002e-12 < x < 3.59999999999999966e-86

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

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

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

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

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

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

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

                                \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                              7. pow2N/A

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

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

                                \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                              10. lift-/.f6451.2

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

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

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

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

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

                                \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                              5. pow2N/A

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

                                \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                              7. sqrt-divN/A

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

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

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

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

                                \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                              12. pow2N/A

                                \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                              13. lift-fma.f6451.1

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

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

                            if 3.59999999999999966e-86 < x < 5.8e-5

                            1. Initial program 72.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. 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}} \]
                            3. Step-by-step derivation
                              1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 14: 69.4% accurate, 2.4× speedup?

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

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

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                            4. Applied rewrites95.0%

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

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

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

                              if -1.56000000000000002e-12 < x < 3.59999999999999966e-86

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

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

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

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

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

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

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

                                  \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                7. pow2N/A

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

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

                                  \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                10. lift-/.f6451.2

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

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

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

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

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

                                  \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                                5. pow2N/A

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

                                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                                7. sqrt-divN/A

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

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

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

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

                                  \[\leadsto \frac{1}{\sqrt{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                                12. pow2N/A

                                  \[\leadsto \frac{1}{\sqrt{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                                13. lift-fma.f6451.1

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

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

                              if 3.59999999999999966e-86 < x < 5.8e-5

                              1. Initial program 72.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. 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}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \cdot F - x}{B} \]
                                7. inv-powN/A

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

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

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

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

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

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

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

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

                            Alternative 15: 69.4% accurate, 2.4× speedup?

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

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

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                              4. Applied rewrites95.0%

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

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

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

                                if -1.56000000000000002e-12 < x < 3.59999999999999966e-86

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

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

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

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

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

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

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

                                    \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  7. pow2N/A

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

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

                                    \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  10. lift-/.f6451.2

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

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

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

                                    \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  3. unpow-1N/A

                                    \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                                  4. pow2N/A

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

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

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

                                    \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                                  8. pow2N/A

                                    \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                                  9. lift-fma.f6451.2

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

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

                                if 3.59999999999999966e-86 < x < 5.8e-5

                                1. Initial program 72.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. 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}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  7. inv-powN/A

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

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

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

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

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

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

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

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

                              Alternative 16: 57.9% accurate, 2.5× speedup?

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

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

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

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

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                                4. Applied rewrites96.6%

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

                                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
                                6. Step-by-step derivation
                                  1. lower-/.f6474.3

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

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

                                if -7.0000000000000001e-15 < F < 3.8999999999999997e41

                                1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  7. inv-powN/A

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                  13. lift-fma.f6451.7

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

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

                                if 3.8999999999999997e41 < F < 1.1500000000000001e144

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

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

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

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

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

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

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

                                    \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  7. pow2N/A

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

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

                                    \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  10. lift-/.f6450.2

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

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

                                  \[\leadsto \frac{1}{F} \cdot \frac{\color{blue}{F}}{\sin B} \]
                                6. Step-by-step derivation
                                  1. inv-powN/A

                                    \[\leadsto {F}^{-1} \cdot \frac{F}{\sin B} \]
                                  2. lower-pow.f6450.2

                                    \[\leadsto {F}^{-1} \cdot \frac{F}{\sin B} \]
                                7. Applied rewrites50.2%

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

                                    \[\leadsto {F}^{-1} \cdot \frac{F}{\sin B} \]
                                  2. inv-powN/A

                                    \[\leadsto \frac{1}{F} \cdot \frac{F}{\sin B} \]
                                  3. lower-/.f6450.2

                                    \[\leadsto \frac{1}{F} \cdot \frac{F}{\sin B} \]
                                9. Applied rewrites50.2%

                                  \[\leadsto \frac{1}{F} \cdot \frac{F}{\sin B} \]

                                if 1.1500000000000001e144 < F

                                1. Initial program 35.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. 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}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

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

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

                                  \[\leadsto \frac{1 - x}{B} \]
                                6. Step-by-step derivation
                                  1. lower--.f6451.4

                                    \[\leadsto \frac{1 - x}{B} \]
                                7. Applied rewrites51.4%

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

                              Alternative 17: 47.3% accurate, 2.6× speedup?

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

                                1. Initial program 74.3%

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  7. inv-powN/A

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

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

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

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

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

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

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

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

                                if 1.6499999999999999e22 < B < 1.25000000000000006e241

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

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

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

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

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

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

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

                                    \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  7. pow2N/A

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

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

                                    \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  10. lift-/.f6430.5

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

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

                                  \[\leadsto \frac{1}{F} \cdot \frac{\color{blue}{F}}{\sin B} \]
                                6. Step-by-step derivation
                                  1. inv-powN/A

                                    \[\leadsto {F}^{-1} \cdot \frac{F}{\sin B} \]
                                  2. lower-pow.f6414.8

                                    \[\leadsto {F}^{-1} \cdot \frac{F}{\sin B} \]
                                7. Applied rewrites14.8%

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

                                    \[\leadsto {F}^{-1} \cdot \frac{F}{\sin B} \]
                                  2. inv-powN/A

                                    \[\leadsto \frac{1}{F} \cdot \frac{F}{\sin B} \]
                                  3. lower-/.f6414.8

                                    \[\leadsto \frac{1}{F} \cdot \frac{F}{\sin B} \]
                                9. Applied rewrites14.8%

                                  \[\leadsto \frac{1}{F} \cdot \frac{F}{\sin B} \]

                                if 1.25000000000000006e241 < B

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

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

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

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

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

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

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

                                    \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  7. pow2N/A

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

                                    \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  9. lift-sin.f64N/A

                                    \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                  10. lift-/.f6428.7

                                    \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                                4. Applied rewrites28.7%

                                  \[\leadsto \color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}} \]
                                5. Taylor expanded in F around -inf

                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                6. Step-by-step derivation
                                  1. lift-sin.f64N/A

                                    \[\leadsto \frac{-1}{\sin B} \]
                                  2. lift-/.f6414.3

                                    \[\leadsto \frac{-1}{\sin B} \]
                                7. Applied rewrites14.3%

                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                              3. Recombined 3 regimes into one program.
                              4. Add Preprocessing

                              Alternative 18: 57.1% accurate, 2.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.17:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \end{array} \end{array} \]
                              (FPCore (F B x)
                               :precision binary64
                               (if (<= B 0.17)
                                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (B <= 0.17) {
                              		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                              	} else {
                              		tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (B <= 0.17)
                              		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 * Float64(1.0 / tan(B)))) + Float64(-1.0 / B));
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := If[LessEqual[B, 0.17], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;B \leq 0.17:\\
                              \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if B < 0.170000000000000012

                                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. 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}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                4. Applied rewrites58.4%

                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                5. Step-by-step derivation
                                  1. lift-pow.f64N/A

                                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                  2. lift-+.f64N/A

                                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                  3. lift-fma.f64N/A

                                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                  4. lift-*.f64N/A

                                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                  5. pow2N/A

                                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                  6. +-commutativeN/A

                                    \[\leadsto \frac{\sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  7. inv-powN/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F - x}{B} \]
                                  8. +-commutativeN/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                  9. associate-+r+N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                  10. pow2N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                  11. lower-/.f64N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                  12. lift-fma.f64N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                  13. lift-fma.f6458.4

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                6. Applied rewrites58.4%

                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]

                                if 0.170000000000000012 < B

                                1. Initial program 86.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. Taylor expanded in F around -inf

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                  2. lift-sin.f6457.7

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                                4. Applied rewrites57.7%

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                5. Taylor expanded in B around 0

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites53.5%

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                                7. Recombined 2 regimes into one program.
                                8. Add Preprocessing

                                Alternative 19: 47.9% accurate, 3.1× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 2.4 \cdot 10^{+22}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= B 2.4e+22)
                                   (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                   (/ -1.0 (sin B))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (B <= 2.4e+22) {
                                		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                                	} else {
                                		tmp = -1.0 / sin(B);
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (B <= 2.4e+22)
                                		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                                	else
                                		tmp = Float64(-1.0 / sin(B));
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[B, 2.4e+22], 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[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;B \leq 2.4 \cdot 10^{+22}:\\
                                \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{-1}{\sin B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if B < 2.4e22

                                  1. Initial program 74.3%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. 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}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites57.2%

                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                  5. Step-by-step derivation
                                    1. lift-pow.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    2. lift-+.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    3. lift-fma.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    4. lift-*.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    5. pow2N/A

                                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    6. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \cdot F - x}{B} \]
                                    7. inv-powN/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F - x}{B} \]
                                    8. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                    9. associate-+r+N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                    10. pow2N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                    11. lower-/.f64N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                    12. lift-fma.f64N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                    13. lift-fma.f6457.2

                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                  6. Applied rewrites57.2%

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]

                                  if 2.4e22 < B

                                  1. Initial program 86.2%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in x around 0

                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                  3. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                                    2. lower-*.f64N/A

                                      \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                                    3. lower-sqrt.f64N/A

                                      \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                                    4. inv-powN/A

                                      \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                    5. lower-pow.f64N/A

                                      \[\leadsto \sqrt{{\left(2 + {F}^{2}\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                    6. +-commutativeN/A

                                      \[\leadsto \sqrt{{\left({F}^{2} + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                    7. pow2N/A

                                      \[\leadsto \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                    8. lower-fma.f64N/A

                                      \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                    9. lift-sin.f64N/A

                                      \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
                                    10. lift-/.f6430.1

                                      \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                                  4. Applied rewrites30.1%

                                    \[\leadsto \color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}} \]
                                  5. Taylor expanded in F around -inf

                                    \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                  6. Step-by-step derivation
                                    1. lift-sin.f64N/A

                                      \[\leadsto \frac{-1}{\sin B} \]
                                    2. lift-/.f6417.4

                                      \[\leadsto \frac{-1}{\sin B} \]
                                  7. Applied rewrites17.4%

                                    \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                3. Recombined 2 regimes into one program.
                                4. Add Preprocessing

                                Alternative 20: 50.9% accurate, 5.7× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.22 \cdot 10^{+154}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\ \mathbf{elif}\;F \leq 10^{+46}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= F -1.22e+154)
                                   (+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
                                   (if (<= F 1e+46)
                                     (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                     (/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -1.22e+154) {
                                		tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
                                	} else if (F <= 1e+46) {
                                		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                                	} else {
                                		tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= -1.22e+154)
                                		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B));
                                	elseif (F <= 1e+46)
                                		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(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B);
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, -1.22e+154], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+46], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;F \leq -1.22 \cdot 10^{+154}:\\
                                \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
                                
                                \mathbf{elif}\;F \leq 10^{+46}:\\
                                \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if F < -1.22e154

                                  1. Initial program 30.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. Taylor expanded in F around -inf

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                    2. lift-sin.f6499.6

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                                  4. Applied rewrites99.6%

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                  5. Taylor expanded in B around 0

                                    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
                                  6. Step-by-step derivation
                                    1. lower-/.f6475.0

                                      \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{-1}{\sin B} \]
                                  7. Applied rewrites75.0%

                                    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
                                  8. Taylor expanded in B around 0

                                    \[\leadsto \left(-\frac{x}{B}\right) + \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{\color{blue}{B}} \]
                                  9. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \left(-\frac{x}{B}\right) + \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                    2. lower--.f64N/A

                                      \[\leadsto \left(-\frac{x}{B}\right) + \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                    3. lower-*.f64N/A

                                      \[\leadsto \left(-\frac{x}{B}\right) + \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                    4. pow2N/A

                                      \[\leadsto \left(-\frac{x}{B}\right) + \frac{\frac{-1}{6} \cdot \left(B \cdot B\right) - 1}{B} \]
                                    5. lift-*.f6452.0

                                      \[\leadsto \left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B} \]
                                  10. Applied rewrites52.0%

                                    \[\leadsto \left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{\color{blue}{B}} \]

                                  if -1.22e154 < F < 9.9999999999999999e45

                                  1. Initial program 97.2%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Taylor expanded in B around 0

                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites51.5%

                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                  5. Step-by-step derivation
                                    1. lift-pow.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    2. lift-+.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    3. lift-fma.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    4. lift-*.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    5. pow2N/A

                                      \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + {F}^{2}\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    6. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{{\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{-1}} \cdot F - x}{B} \]
                                    7. inv-powN/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F - x}{B} \]
                                    8. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                    9. associate-+r+N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                    10. pow2N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                    11. lower-/.f64N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                    12. lift-fma.f64N/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                    13. lift-fma.f6451.5

                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                  6. Applied rewrites51.5%

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]

                                  if 9.9999999999999999e45 < F

                                  1. Initial program 52.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. 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}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites36.4%

                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                  5. Taylor expanded in F around inf

                                    \[\leadsto \frac{1 - x}{B} \]
                                  6. Step-by-step derivation
                                    1. lower--.f6451.1

                                      \[\leadsto \frac{1 - x}{B} \]
                                  7. Applied rewrites51.1%

                                    \[\leadsto \frac{1 - x}{B} \]
                                  8. Step-by-step derivation
                                    1. lift--.f64N/A

                                      \[\leadsto \frac{1 - x}{B} \]
                                    2. flip--N/A

                                      \[\leadsto \frac{\frac{1 \cdot 1 - x \cdot x}{1 + x}}{B} \]
                                    3. lower-/.f64N/A

                                      \[\leadsto \frac{\frac{1 \cdot 1 - x \cdot x}{1 + x}}{B} \]
                                    4. metadata-evalN/A

                                      \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                    5. unpow2N/A

                                      \[\leadsto \frac{\frac{1 - {x}^{2}}{1 + x}}{B} \]
                                    6. lower--.f64N/A

                                      \[\leadsto \frac{\frac{1 - {x}^{2}}{1 + x}}{B} \]
                                    7. unpow2N/A

                                      \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                    8. lower-*.f64N/A

                                      \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                    9. lower-+.f6448.6

                                      \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                  9. Applied rewrites48.6%

                                    \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                3. Recombined 3 regimes into one program.
                                4. Add Preprocessing

                                Alternative 21: 49.5% accurate, 7.2× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{-15}:\\ \;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{+33}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= F -7e-15)
                                   (/ (- (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) 1.0) x) B)
                                   (if (<= F 2.8e+33)
                                     (/ (- (* (sqrt 0.5) F) x) B)
                                     (/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -7e-15) {
                                		tmp = ((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - 1.0) - x) / B;
                                	} else if (F <= 2.8e+33) {
                                		tmp = ((sqrt(0.5) * F) - x) / B;
                                	} else {
                                		tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= -7e-15)
                                		tmp = Float64(Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - 1.0) - x) / B);
                                	elseif (F <= 2.8e+33)
                                		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                                	else
                                		tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B);
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, -7e-15], N[(N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.8e+33], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;F \leq -7 \cdot 10^{-15}:\\
                                \;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B}\\
                                
                                \mathbf{elif}\;F \leq 2.8 \cdot 10^{+33}:\\
                                \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if F < -7.0000000000000001e-15

                                  1. Initial program 59.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. 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}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites39.8%

                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                  5. Taylor expanded in F around -inf

                                    \[\leadsto \frac{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - \left(1 + x\right)}{B} \]
                                  6. Step-by-step derivation
                                    1. metadata-evalN/A

                                      \[\leadsto \frac{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - \left(1 + x\right)}{B} \]
                                    2. associate--r+N/A

                                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                    3. lower--.f64N/A

                                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                  7. Applied rewrites49.5%

                                    \[\leadsto \frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B} \]

                                  if -7.0000000000000001e-15 < F < 2.8000000000000001e33

                                  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. 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}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                  4. Applied rewrites51.6%

                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                  5. Taylor expanded in F around 0

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                  6. Step-by-step derivation
                                    1. inv-powN/A

                                      \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                    2. lower-pow.f64N/A

                                      \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                    3. +-commutativeN/A

                                      \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                    4. lower-fma.f6449.9

                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  7. Applied rewrites49.9%

                                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                  8. Taylor expanded in x around 0

                                    \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                  9. Step-by-step derivation
                                    1. Applied rewrites49.9%

                                      \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                    if 2.8000000000000001e33 < F

                                    1. Initial program 54.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. 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}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                    4. Applied rewrites37.1%

                                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                    5. Taylor expanded in F around inf

                                      \[\leadsto \frac{1 - x}{B} \]
                                    6. Step-by-step derivation
                                      1. lower--.f6451.1

                                        \[\leadsto \frac{1 - x}{B} \]
                                    7. Applied rewrites51.1%

                                      \[\leadsto \frac{1 - x}{B} \]
                                    8. Step-by-step derivation
                                      1. lift--.f64N/A

                                        \[\leadsto \frac{1 - x}{B} \]
                                      2. flip--N/A

                                        \[\leadsto \frac{\frac{1 \cdot 1 - x \cdot x}{1 + x}}{B} \]
                                      3. lower-/.f64N/A

                                        \[\leadsto \frac{\frac{1 \cdot 1 - x \cdot x}{1 + x}}{B} \]
                                      4. metadata-evalN/A

                                        \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                      5. unpow2N/A

                                        \[\leadsto \frac{\frac{1 - {x}^{2}}{1 + x}}{B} \]
                                      6. lower--.f64N/A

                                        \[\leadsto \frac{\frac{1 - {x}^{2}}{1 + x}}{B} \]
                                      7. unpow2N/A

                                        \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                      8. lower-*.f64N/A

                                        \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                      9. lower-+.f6448.7

                                        \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                    9. Applied rewrites48.7%

                                      \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                  10. Recombined 3 regimes into one program.
                                  11. Add Preprocessing

                                  Alternative 22: 50.0% accurate, 8.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{+33}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\ \end{array} \end{array} \]
                                  (FPCore (F B x)
                                   :precision binary64
                                   (if (<= F -1.4)
                                     (/ (- -1.0 x) B)
                                     (if (<= F 2.8e+33)
                                       (/ (- (* (sqrt 0.5) F) x) B)
                                       (/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
                                  double code(double F, double B, double x) {
                                  	double tmp;
                                  	if (F <= -1.4) {
                                  		tmp = (-1.0 - x) / B;
                                  	} else if (F <= 2.8e+33) {
                                  		tmp = ((sqrt(0.5) * F) - x) / B;
                                  	} else {
                                  		tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(f, b, x)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: f
                                      real(8), intent (in) :: b
                                      real(8), intent (in) :: x
                                      real(8) :: tmp
                                      if (f <= (-1.4d0)) then
                                          tmp = ((-1.0d0) - x) / b
                                      else if (f <= 2.8d+33) then
                                          tmp = ((sqrt(0.5d0) * f) - x) / b
                                      else
                                          tmp = ((1.0d0 - (x * x)) / (1.0d0 + x)) / b
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double F, double B, double x) {
                                  	double tmp;
                                  	if (F <= -1.4) {
                                  		tmp = (-1.0 - x) / B;
                                  	} else if (F <= 2.8e+33) {
                                  		tmp = ((Math.sqrt(0.5) * F) - x) / B;
                                  	} else {
                                  		tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(F, B, x):
                                  	tmp = 0
                                  	if F <= -1.4:
                                  		tmp = (-1.0 - x) / B
                                  	elif F <= 2.8e+33:
                                  		tmp = ((math.sqrt(0.5) * F) - x) / B
                                  	else:
                                  		tmp = ((1.0 - (x * x)) / (1.0 + x)) / B
                                  	return tmp
                                  
                                  function code(F, B, x)
                                  	tmp = 0.0
                                  	if (F <= -1.4)
                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                  	elseif (F <= 2.8e+33)
                                  		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                                  	else
                                  		tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B);
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(F, B, x)
                                  	tmp = 0.0;
                                  	if (F <= -1.4)
                                  		tmp = (-1.0 - x) / B;
                                  	elseif (F <= 2.8e+33)
                                  		tmp = ((sqrt(0.5) * F) - x) / B;
                                  	else
                                  		tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.8e+33], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;F \leq -1.4:\\
                                  \;\;\;\;\frac{-1 - x}{B}\\
                                  
                                  \mathbf{elif}\;F \leq 2.8 \cdot 10^{+33}:\\
                                  \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if F < -1.3999999999999999

                                    1. Initial program 58.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. 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}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                    4. Applied rewrites39.5%

                                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                    5. Taylor expanded in F around 0

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                    6. Step-by-step derivation
                                      1. inv-powN/A

                                        \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                      2. lower-pow.f64N/A

                                        \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                      3. +-commutativeN/A

                                        \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                      4. lower-fma.f6413.8

                                        \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                    7. Applied rewrites13.8%

                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                    8. Taylor expanded in F around -inf

                                      \[\leadsto \frac{-1 - x}{B} \]
                                    9. Step-by-step derivation
                                      1. Applied rewrites51.5%

                                        \[\leadsto \frac{-1 - x}{B} \]

                                      if -1.3999999999999999 < F < 2.8000000000000001e33

                                      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. 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}} \]
                                      3. Step-by-step derivation
                                        1. lower-/.f64N/A

                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                      4. Applied rewrites51.5%

                                        \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                      5. Taylor expanded in F around 0

                                        \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                      6. Step-by-step derivation
                                        1. inv-powN/A

                                          \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                        2. lower-pow.f64N/A

                                          \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                        3. +-commutativeN/A

                                          \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                        4. lower-fma.f6449.8

                                          \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                      7. Applied rewrites49.8%

                                        \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                      8. Taylor expanded in x around 0

                                        \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                      9. Step-by-step derivation
                                        1. Applied rewrites49.7%

                                          \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                        if 2.8000000000000001e33 < F

                                        1. Initial program 54.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. 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}} \]
                                        3. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                        4. Applied rewrites37.1%

                                          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                        5. Taylor expanded in F around inf

                                          \[\leadsto \frac{1 - x}{B} \]
                                        6. Step-by-step derivation
                                          1. lower--.f6451.1

                                            \[\leadsto \frac{1 - x}{B} \]
                                        7. Applied rewrites51.1%

                                          \[\leadsto \frac{1 - x}{B} \]
                                        8. Step-by-step derivation
                                          1. lift--.f64N/A

                                            \[\leadsto \frac{1 - x}{B} \]
                                          2. flip--N/A

                                            \[\leadsto \frac{\frac{1 \cdot 1 - x \cdot x}{1 + x}}{B} \]
                                          3. lower-/.f64N/A

                                            \[\leadsto \frac{\frac{1 \cdot 1 - x \cdot x}{1 + x}}{B} \]
                                          4. metadata-evalN/A

                                            \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                          5. unpow2N/A

                                            \[\leadsto \frac{\frac{1 - {x}^{2}}{1 + x}}{B} \]
                                          6. lower--.f64N/A

                                            \[\leadsto \frac{\frac{1 - {x}^{2}}{1 + x}}{B} \]
                                          7. unpow2N/A

                                            \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                          8. lower-*.f64N/A

                                            \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                          9. lower-+.f6448.7

                                            \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                        9. Applied rewrites48.7%

                                          \[\leadsto \frac{\frac{1 - x \cdot x}{1 + x}}{B} \]
                                      10. Recombined 3 regimes into one program.
                                      11. Add Preprocessing

                                      Alternative 23: 50.9% accurate, 8.8× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                      (FPCore (F B x)
                                       :precision binary64
                                       (if (<= F -1.4)
                                         (/ (- -1.0 x) B)
                                         (if (<= F 1.45e+20) (/ (- (* (sqrt 0.5) F) x) B) (/ (- 1.0 x) B))))
                                      double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -1.4) {
                                      		tmp = (-1.0 - x) / B;
                                      	} else if (F <= 1.45e+20) {
                                      		tmp = ((sqrt(0.5) * F) - x) / B;
                                      	} else {
                                      		tmp = (1.0 - x) / B;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(f, b, x)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: f
                                          real(8), intent (in) :: b
                                          real(8), intent (in) :: x
                                          real(8) :: tmp
                                          if (f <= (-1.4d0)) then
                                              tmp = ((-1.0d0) - x) / b
                                          else if (f <= 1.45d+20) then
                                              tmp = ((sqrt(0.5d0) * f) - x) / b
                                          else
                                              tmp = (1.0d0 - x) / b
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -1.4) {
                                      		tmp = (-1.0 - x) / B;
                                      	} else if (F <= 1.45e+20) {
                                      		tmp = ((Math.sqrt(0.5) * F) - x) / B;
                                      	} else {
                                      		tmp = (1.0 - x) / B;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(F, B, x):
                                      	tmp = 0
                                      	if F <= -1.4:
                                      		tmp = (-1.0 - x) / B
                                      	elif F <= 1.45e+20:
                                      		tmp = ((math.sqrt(0.5) * F) - x) / B
                                      	else:
                                      		tmp = (1.0 - x) / B
                                      	return tmp
                                      
                                      function code(F, B, x)
                                      	tmp = 0.0
                                      	if (F <= -1.4)
                                      		tmp = Float64(Float64(-1.0 - x) / B);
                                      	elseif (F <= 1.45e+20)
                                      		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                                      	else
                                      		tmp = Float64(Float64(1.0 - x) / B);
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(F, B, x)
                                      	tmp = 0.0;
                                      	if (F <= -1.4)
                                      		tmp = (-1.0 - x) / B;
                                      	elseif (F <= 1.45e+20)
                                      		tmp = ((sqrt(0.5) * F) - x) / B;
                                      	else
                                      		tmp = (1.0 - x) / B;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45e+20], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;F \leq -1.4:\\
                                      \;\;\;\;\frac{-1 - x}{B}\\
                                      
                                      \mathbf{elif}\;F \leq 1.45 \cdot 10^{+20}:\\
                                      \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{1 - x}{B}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if F < -1.3999999999999999

                                        1. Initial program 58.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. 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}} \]
                                        3. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                        4. Applied rewrites39.5%

                                          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                        5. Taylor expanded in F around 0

                                          \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                        6. Step-by-step derivation
                                          1. inv-powN/A

                                            \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                          2. lower-pow.f64N/A

                                            \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                          3. +-commutativeN/A

                                            \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                          4. lower-fma.f6413.8

                                            \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                        7. Applied rewrites13.8%

                                          \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                        8. Taylor expanded in F around -inf

                                          \[\leadsto \frac{-1 - x}{B} \]
                                        9. Step-by-step derivation
                                          1. Applied rewrites51.5%

                                            \[\leadsto \frac{-1 - x}{B} \]

                                          if -1.3999999999999999 < F < 1.45e20

                                          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. 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}} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                          4. Applied rewrites51.5%

                                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                          5. Taylor expanded in F around 0

                                            \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                          6. Step-by-step derivation
                                            1. inv-powN/A

                                              \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                            2. lower-pow.f64N/A

                                              \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                            3. +-commutativeN/A

                                              \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                            4. lower-fma.f6450.5

                                              \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                          7. Applied rewrites50.5%

                                            \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                          8. Taylor expanded in x around 0

                                            \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                          9. Step-by-step derivation
                                            1. Applied rewrites50.4%

                                              \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                            if 1.45e20 < F

                                            1. Initial program 56.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. 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}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                            4. Applied rewrites37.7%

                                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                            5. Taylor expanded in F around inf

                                              \[\leadsto \frac{1 - x}{B} \]
                                            6. Step-by-step derivation
                                              1. lower--.f6451.2

                                                \[\leadsto \frac{1 - x}{B} \]
                                            7. Applied rewrites51.2%

                                              \[\leadsto \frac{1 - x}{B} \]
                                          10. Recombined 3 regimes into one program.
                                          11. Add Preprocessing

                                          Alternative 24: 43.7% accurate, 13.6× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-53}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= F -2.6e-44)
                                             (/ (- -1.0 x) B)
                                             (if (<= F 1.65e-53) (/ (- x) B) (/ (- 1.0 x) B))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -2.6e-44) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else if (F <= 1.65e-53) {
                                          		tmp = -x / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          module fmin_fmax_functions
                                              implicit none
                                              private
                                              public fmax
                                              public fmin
                                          
                                              interface fmax
                                                  module procedure fmax88
                                                  module procedure fmax44
                                                  module procedure fmax84
                                                  module procedure fmax48
                                              end interface
                                              interface fmin
                                                  module procedure fmin88
                                                  module procedure fmin44
                                                  module procedure fmin84
                                                  module procedure fmin48
                                              end interface
                                          contains
                                              real(8) function fmax88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmax44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmax84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmax48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmin44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmin48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                              end function
                                          end module
                                          
                                          real(8) function code(f, b, x)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: f
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: x
                                              real(8) :: tmp
                                              if (f <= (-2.6d-44)) then
                                                  tmp = ((-1.0d0) - x) / b
                                              else if (f <= 1.65d-53) then
                                                  tmp = -x / b
                                              else
                                                  tmp = (1.0d0 - x) / b
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -2.6e-44) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else if (F <= 1.65e-53) {
                                          		tmp = -x / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	tmp = 0
                                          	if F <= -2.6e-44:
                                          		tmp = (-1.0 - x) / B
                                          	elif F <= 1.65e-53:
                                          		tmp = -x / B
                                          	else:
                                          		tmp = (1.0 - x) / B
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= -2.6e-44)
                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                          	elseif (F <= 1.65e-53)
                                          		tmp = Float64(Float64(-x) / B);
                                          	else
                                          		tmp = Float64(Float64(1.0 - x) / B);
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	tmp = 0.0;
                                          	if (F <= -2.6e-44)
                                          		tmp = (-1.0 - x) / B;
                                          	elseif (F <= 1.65e-53)
                                          		tmp = -x / B;
                                          	else
                                          		tmp = (1.0 - x) / B;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, -2.6e-44], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.65e-53], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq -2.6 \cdot 10^{-44}:\\
                                          \;\;\;\;\frac{-1 - x}{B}\\
                                          
                                          \mathbf{elif}\;F \leq 1.65 \cdot 10^{-53}:\\
                                          \;\;\;\;\frac{-x}{B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{1 - x}{B}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if F < -2.5999999999999998e-44

                                            1. Initial program 62.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. 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}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                            4. Applied rewrites40.9%

                                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                            5. Taylor expanded in F around 0

                                              \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                            6. Step-by-step derivation
                                              1. inv-powN/A

                                                \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                              2. lower-pow.f64N/A

                                                \[\leadsto \frac{\sqrt{{\left(2 + 2 \cdot x\right)}^{-1}} \cdot F - x}{B} \]
                                              3. +-commutativeN/A

                                                \[\leadsto \frac{\sqrt{{\left(2 \cdot x + 2\right)}^{-1}} \cdot F - x}{B} \]
                                              4. lower-fma.f6418.1

                                                \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                            7. Applied rewrites18.1%

                                              \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                            8. Taylor expanded in F around -inf

                                              \[\leadsto \frac{-1 - x}{B} \]
                                            9. Step-by-step derivation
                                              1. Applied rewrites47.9%

                                                \[\leadsto \frac{-1 - x}{B} \]

                                              if -2.5999999999999998e-44 < F < 1.65000000000000002e-53

                                              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. 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}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites51.4%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around 0

                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                              6. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                2. lower-neg.f6437.5

                                                  \[\leadsto \frac{-x}{B} \]
                                              7. Applied rewrites37.5%

                                                \[\leadsto \frac{-x}{B} \]

                                              if 1.65000000000000002e-53 < F

                                              1. Initial program 63.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. 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}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites40.0%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around inf

                                                \[\leadsto \frac{1 - x}{B} \]
                                              6. Step-by-step derivation
                                                1. lower--.f6447.3

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              7. Applied rewrites47.3%

                                                \[\leadsto \frac{1 - x}{B} \]
                                            10. Recombined 3 regimes into one program.
                                            11. Add Preprocessing

                                            Alternative 25: 32.1% accurate, 14.1× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{B}\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{-128}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-119}:\\ \;\;\;\;\frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (let* ((t_0 (/ (- x) B)))
                                               (if (<= x -7.5e-128) t_0 (if (<= x 2.8e-119) (/ 1.0 B) t_0))))
                                            double code(double F, double B, double x) {
                                            	double t_0 = -x / B;
                                            	double tmp;
                                            	if (x <= -7.5e-128) {
                                            		tmp = t_0;
                                            	} else if (x <= 2.8e-119) {
                                            		tmp = 1.0 / B;
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            module fmin_fmax_functions
                                                implicit none
                                                private
                                                public fmax
                                                public fmin
                                            
                                                interface fmax
                                                    module procedure fmax88
                                                    module procedure fmax44
                                                    module procedure fmax84
                                                    module procedure fmax48
                                                end interface
                                                interface fmin
                                                    module procedure fmin88
                                                    module procedure fmin44
                                                    module procedure fmin84
                                                    module procedure fmin48
                                                end interface
                                            contains
                                                real(8) function fmax88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmax44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmax84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmax48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmin44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmin48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                end function
                                            end module
                                            
                                            real(8) function code(f, b, x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: f
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: x
                                                real(8) :: t_0
                                                real(8) :: tmp
                                                t_0 = -x / b
                                                if (x <= (-7.5d-128)) then
                                                    tmp = t_0
                                                else if (x <= 2.8d-119) then
                                                    tmp = 1.0d0 / b
                                                else
                                                    tmp = t_0
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double t_0 = -x / B;
                                            	double tmp;
                                            	if (x <= -7.5e-128) {
                                            		tmp = t_0;
                                            	} else if (x <= 2.8e-119) {
                                            		tmp = 1.0 / B;
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	t_0 = -x / B
                                            	tmp = 0
                                            	if x <= -7.5e-128:
                                            		tmp = t_0
                                            	elif x <= 2.8e-119:
                                            		tmp = 1.0 / B
                                            	else:
                                            		tmp = t_0
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	t_0 = Float64(Float64(-x) / B)
                                            	tmp = 0.0
                                            	if (x <= -7.5e-128)
                                            		tmp = t_0;
                                            	elseif (x <= 2.8e-119)
                                            		tmp = Float64(1.0 / B);
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	t_0 = -x / B;
                                            	tmp = 0.0;
                                            	if (x <= -7.5e-128)
                                            		tmp = t_0;
                                            	elseif (x <= 2.8e-119)
                                            		tmp = 1.0 / B;
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -7.5e-128], t$95$0, If[LessEqual[x, 2.8e-119], N[(1.0 / B), $MachinePrecision], t$95$0]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := \frac{-x}{B}\\
                                            \mathbf{if}\;x \leq -7.5 \cdot 10^{-128}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;x \leq 2.8 \cdot 10^{-119}:\\
                                            \;\;\;\;\frac{1}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if x < -7.50000000000000021e-128 or 2.8e-119 < x

                                              1. Initial program 78.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. 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}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites47.3%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around 0

                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                              6. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                2. lower-neg.f6441.2

                                                  \[\leadsto \frac{-x}{B} \]
                                              7. Applied rewrites41.2%

                                                \[\leadsto \frac{-x}{B} \]

                                              if -7.50000000000000021e-128 < x < 2.8e-119

                                              1. Initial program 73.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. 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}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites39.8%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around inf

                                                \[\leadsto \frac{1 - x}{B} \]
                                              6. Step-by-step derivation
                                                1. lower--.f6415.4

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              7. Applied rewrites15.4%

                                                \[\leadsto \frac{1 - x}{B} \]
                                              8. Taylor expanded in x around 0

                                                \[\leadsto \frac{1}{B} \]
                                              9. Step-by-step derivation
                                                1. Applied rewrites15.4%

                                                  \[\leadsto \frac{1}{B} \]
                                              10. Recombined 2 regimes into one program.
                                              11. Add Preprocessing

                                              Alternative 26: 37.1% accurate, 17.5× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.65 \cdot 10^{-53}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                              (FPCore (F B x)
                                               :precision binary64
                                               (if (<= F 1.65e-53) (/ (- x) B) (/ (- 1.0 x) B)))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= 1.65e-53) {
                                              		tmp = -x / B;
                                              	} else {
                                              		tmp = (1.0 - x) / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              module fmin_fmax_functions
                                                  implicit none
                                                  private
                                                  public fmax
                                                  public fmin
                                              
                                                  interface fmax
                                                      module procedure fmax88
                                                      module procedure fmax44
                                                      module procedure fmax84
                                                      module procedure fmax48
                                                  end interface
                                                  interface fmin
                                                      module procedure fmin88
                                                      module procedure fmin44
                                                      module procedure fmin84
                                                      module procedure fmin48
                                                  end interface
                                              contains
                                                  real(8) function fmax88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmax44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmin44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                  end function
                                              end module
                                              
                                              real(8) function code(f, b, x)
                                              use fmin_fmax_functions
                                                  real(8), intent (in) :: f
                                                  real(8), intent (in) :: b
                                                  real(8), intent (in) :: x
                                                  real(8) :: tmp
                                                  if (f <= 1.65d-53) then
                                                      tmp = -x / b
                                                  else
                                                      tmp = (1.0d0 - x) / b
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= 1.65e-53) {
                                              		tmp = -x / B;
                                              	} else {
                                              		tmp = (1.0 - x) / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(F, B, x):
                                              	tmp = 0
                                              	if F <= 1.65e-53:
                                              		tmp = -x / B
                                              	else:
                                              		tmp = (1.0 - x) / B
                                              	return tmp
                                              
                                              function code(F, B, x)
                                              	tmp = 0.0
                                              	if (F <= 1.65e-53)
                                              		tmp = Float64(Float64(-x) / B);
                                              	else
                                              		tmp = Float64(Float64(1.0 - x) / B);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(F, B, x)
                                              	tmp = 0.0;
                                              	if (F <= 1.65e-53)
                                              		tmp = -x / B;
                                              	else
                                              		tmp = (1.0 - x) / B;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[F_, B_, x_] := If[LessEqual[F, 1.65e-53], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;F \leq 1.65 \cdot 10^{-53}:\\
                                              \;\;\;\;\frac{-x}{B}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{1 - x}{B}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if F < 1.65000000000000002e-53

                                                1. Initial program 83.2%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                4. Applied rewrites46.7%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                5. Taylor expanded in F around 0

                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                6. Step-by-step derivation
                                                  1. mul-1-negN/A

                                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                  2. lower-neg.f6432.6

                                                    \[\leadsto \frac{-x}{B} \]
                                                7. Applied rewrites32.6%

                                                  \[\leadsto \frac{-x}{B} \]

                                                if 1.65000000000000002e-53 < F

                                                1. Initial program 63.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. 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}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                4. Applied rewrites40.0%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                5. Taylor expanded in F around inf

                                                  \[\leadsto \frac{1 - x}{B} \]
                                                6. Step-by-step derivation
                                                  1. lower--.f6447.3

                                                    \[\leadsto \frac{1 - x}{B} \]
                                                7. Applied rewrites47.3%

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              3. Recombined 2 regimes into one program.
                                              4. Add Preprocessing

                                              Alternative 27: 9.7% accurate, 30.7× speedup?

                                              \[\begin{array}{l} \\ \frac{1}{B} \end{array} \]
                                              (FPCore (F B x) :precision binary64 (/ 1.0 B))
                                              double code(double F, double B, double x) {
                                              	return 1.0 / B;
                                              }
                                              
                                              module fmin_fmax_functions
                                                  implicit none
                                                  private
                                                  public fmax
                                                  public fmin
                                              
                                                  interface fmax
                                                      module procedure fmax88
                                                      module procedure fmax44
                                                      module procedure fmax84
                                                      module procedure fmax48
                                                  end interface
                                                  interface fmin
                                                      module procedure fmin88
                                                      module procedure fmin44
                                                      module procedure fmin84
                                                      module procedure fmin48
                                                  end interface
                                              contains
                                                  real(8) function fmax88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmax44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmin44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                  end function
                                              end module
                                              
                                              real(8) function code(f, b, x)
                                              use fmin_fmax_functions
                                                  real(8), intent (in) :: f
                                                  real(8), intent (in) :: b
                                                  real(8), intent (in) :: x
                                                  code = 1.0d0 / b
                                              end function
                                              
                                              public static double code(double F, double B, double x) {
                                              	return 1.0 / B;
                                              }
                                              
                                              def code(F, B, x):
                                              	return 1.0 / B
                                              
                                              function code(F, B, x)
                                              	return Float64(1.0 / B)
                                              end
                                              
                                              function tmp = code(F, B, x)
                                              	tmp = 1.0 / B;
                                              end
                                              
                                              code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \frac{1}{B}
                                              \end{array}
                                              
                                              Derivation
                                              1. Initial program 77.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. 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}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites44.7%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around inf

                                                \[\leadsto \frac{1 - x}{B} \]
                                              6. Step-by-step derivation
                                                1. lower--.f6429.7

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              7. Applied rewrites29.7%

                                                \[\leadsto \frac{1 - x}{B} \]
                                              8. Taylor expanded in x around 0

                                                \[\leadsto \frac{1}{B} \]
                                              9. Step-by-step derivation
                                                1. Applied rewrites9.7%

                                                  \[\leadsto \frac{1}{B} \]
                                                2. Add Preprocessing

                                                Reproduce

                                                ?
                                                herbie shell --seed 2025106 
                                                (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))))))