VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.7%
Time: 8.7s
Alternatives: 23
Speedup: 1.5×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 23 alternatives:

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

Initial Program: 76.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 57.2%

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

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

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

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

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    6. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B} \]
      13. lift-sin.f6499.7

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

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

    if -5.0000000000000001e26 < F < 1e8

    1. Initial program 99.4%

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

        \[\leadsto \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}} \]
    4. Applied rewrites99.4%

      \[\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}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      3. pow299.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      4. associate-+r+99.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      5. pow299.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      6. metadata-eval99.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      7. sqrt-pow199.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      8. *-commutative99.8

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

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

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

Alternative 2: 99.6% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 57.2%

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

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

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

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

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    6. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B} \]
      13. lift-sin.f6499.7

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

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

    if -5.0000000000000001e26 < F < 1e8

    1. Initial program 99.4%

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

        \[\leadsto \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}} \]
    4. Applied rewrites99.4%

      \[\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}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
    7. 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)} \]
    8. 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) \]
    9. Applied rewrites99.5%

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

    if 1e8 < F

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      3. pow299.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      4. associate-+r+99.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      5. pow299.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      6. metadata-eval99.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      7. sqrt-pow199.8

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
      8. *-commutative99.8

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

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

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

Alternative 3: 91.7% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 60.4%

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

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

        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
    5. Applied rewrites98.0%

      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
    6. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B} \]
      13. lift-sin.f6498.0

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

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

    if -3.3999999999999999e-11 < F < 5.0000000000000004e-19

    1. Initial program 99.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. 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}} \]
    4. Applied rewrites99.3%

      \[\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}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot 1}{\tan B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
    7. 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)} \]
    8. 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) \]
    9. Step-by-step derivation
      1. Applied rewrites77.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 5.0000000000000004e-19 < F

      1. Initial program 75.5%

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

          \[\leadsto \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}} \]
      4. Applied rewrites84.9%

        \[\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}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        2. +-commutative96.9

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        3. pow296.9

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        4. associate-+r+96.9

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        5. pow296.9

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        6. metadata-eval96.9

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        7. sqrt-pow196.9

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        8. *-commutative96.9

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

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

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

    Alternative 4: 85.0% accurate, 1.5× speedup?

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

      1. Initial program 62.4%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
      6. Step-by-step derivation
        1. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B} \]
        13. lift-sin.f6495.8

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

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

      if -2.19999999999999994e-35 < F < -5.7999999999999999e-97

      1. Initial program 99.3%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. 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}} \]
      4. Applied rewrites99.4%

        \[\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}} \]
      5. Taylor expanded in x around 0

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
        2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
        13. lift-fma.f6463.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.7999999999999999e-97 < F < 1.19999999999999999e-147

      1. Initial program 99.3%

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

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

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

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

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

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

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

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

          \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
      5. Applied rewrites75.7%

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

      if 1.19999999999999999e-147 < F < 5.4999999999999996e-19

      1. Initial program 99.4%

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

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

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

        \[\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}} \]
      5. Taylor expanded in x around 0

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
        2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
        13. lift-fma.f6469.0

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

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

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

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

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

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

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

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

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

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

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

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

      if 5.4999999999999996e-19 < F

      1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        4. associate-+r+98.4

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

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

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B} \]
        7. sqrt-pow198.4

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

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

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

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

    Alternative 5: 85.0% accurate, 1.5× speedup?

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

      1. Initial program 62.4%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
      6. Step-by-step derivation
        1. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B} \]
        13. lift-sin.f6495.8

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

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

      if -2.19999999999999994e-35 < F < -5.7999999999999999e-97

      1. Initial program 99.3%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Add Preprocessing
      3. 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}} \]
      4. Applied rewrites99.4%

        \[\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}} \]
      5. Taylor expanded in x around 0

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
        2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
        13. lift-fma.f6463.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.7999999999999999e-97 < F < 1.19999999999999999e-147

      1. Initial program 99.3%

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

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

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

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

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

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

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

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

          \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
      5. Applied rewrites75.7%

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

      if 1.19999999999999999e-147 < F < 5.4999999999999996e-19

      1. Initial program 99.4%

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

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

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

        \[\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}} \]
      5. Taylor expanded in x around 0

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
        2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
        13. lift-fma.f6469.0

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

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

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

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

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

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

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

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

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

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

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

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

      if 5.4999999999999996e-19 < F

      1. Initial program 75.1%

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. 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.f6498.3

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
      5. Applied rewrites98.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-35}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B}\\ \mathbf{elif}\;F \leq -5.8 \cdot 10^{-97}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-147}:\\ \;\;\;\;\frac{\cos B \cdot x}{-\sin B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 78.9% accurate, 1.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -15:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-147}:\\ \;\;\;\;\frac{t\_0}{-\sin B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\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 -15.0)
         (/ (- -1.0 x) (sin B))
         (if (<= F 1.2e-147)
           (/ t_0 (- (sin B)))
           (if (<= F 5.5e-19)
             (* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0))))
             (/ (- 1.0 t_0) (sin B)))))))
    double code(double F, double B, double x) {
    	double t_0 = cos(B) * x;
    	double tmp;
    	if (F <= -15.0) {
    		tmp = (-1.0 - x) / sin(B);
    	} else if (F <= 1.2e-147) {
    		tmp = t_0 / -sin(B);
    	} else if (F <= 5.5e-19) {
    		tmp = (F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0)));
    	} 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 <= -15.0)
    		tmp = Float64(Float64(-1.0 - x) / sin(B));
    	elseif (F <= 1.2e-147)
    		tmp = Float64(t_0 / Float64(-sin(B)));
    	elseif (F <= 5.5e-19)
    		tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0))));
    	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, -15.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e-147], N[(t$95$0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5.5e-19], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $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 -15:\\
    \;\;\;\;\frac{-1 - x}{\sin B}\\
    
    \mathbf{elif}\;F \leq 1.2 \cdot 10^{-147}:\\
    \;\;\;\;\frac{t\_0}{-\sin B}\\
    
    \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\
    \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - t\_0}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if F < -15

      1. Initial program 58.9%

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

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

          \[\leadsto \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.1

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

        \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
      6. Taylor expanded in B around 0

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

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

        if -15 < F < 1.19999999999999999e-147

        1. Initial program 99.3%

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

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

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

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

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

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

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

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

            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
        5. Applied rewrites67.9%

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

        if 1.19999999999999999e-147 < F < 5.4999999999999996e-19

        1. Initial program 99.4%

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

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

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

          \[\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}} \]
        5. Taylor expanded in x around 0

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
          2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
          13. lift-fma.f6469.0

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

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

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

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

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

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

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

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

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

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

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

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

        if 5.4999999999999996e-19 < F

        1. Initial program 75.1%

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

          \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
        4. 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.f6498.3

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
        5. Applied rewrites98.3%

          \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
      8. Recombined 4 regimes into one program.
      9. Final simplification77.7%

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

      Alternative 7: 67.2% accurate, 1.6× speedup?

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

        1. Initial program 85.2%

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

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

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

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

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

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

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

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

            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
        5. Applied rewrites77.8%

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

        if -1.0200000000000001e-105 < x < 1.80000000000000005e-111

        1. Initial program 74.2%

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

            \[\leadsto \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}} \]
        4. Applied rewrites79.8%

          \[\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}} \]
        5. Taylor expanded in x around 0

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
          2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
          13. lift-fma.f6463.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.80000000000000005e-111 < x

        1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 8: 64.9% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;x \leq -0.0066:\\ \;\;\;\;t\_0 + \frac{F}{B \cdot \mathsf{fma}\left(B \cdot B, 0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, 1\right)} \cdot \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, -0.5, 1\right)}{F}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-111}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{F}{B \cdot \mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right)} \cdot \frac{-1}{F}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0 (* x (/ -1.0 (tan B)))))
         (if (<= x -0.0066)
           (+
            t_0
            (*
             (/
              F
              (*
               B
               (fma
                (* B B)
                (- (* 0.008333333333333333 (* B B)) 0.16666666666666666)
                1.0)))
             (/ (fma (/ (fma 2.0 x 2.0) (* F F)) -0.5 1.0) F)))
           (if (<= x 1.8e-111)
             (* (/ F (sin B)) (/ 1.0 (sqrt (fma F F 2.0))))
             (+
              t_0
              (* (/ F (* B (fma -0.16666666666666666 (* B B) 1.0))) (/ -1.0 F)))))))
      double code(double F, double B, double x) {
      	double t_0 = x * (-1.0 / tan(B));
      	double tmp;
      	if (x <= -0.0066) {
      		tmp = t_0 + ((F / (B * fma((B * B), ((0.008333333333333333 * (B * B)) - 0.16666666666666666), 1.0))) * (fma((fma(2.0, x, 2.0) / (F * F)), -0.5, 1.0) / F));
      	} else if (x <= 1.8e-111) {
      		tmp = (F / sin(B)) * (1.0 / sqrt(fma(F, F, 2.0)));
      	} else {
      		tmp = t_0 + ((F / (B * fma(-0.16666666666666666, (B * B), 1.0))) * (-1.0 / F));
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(x * Float64(-1.0 / tan(B)))
      	tmp = 0.0
      	if (x <= -0.0066)
      		tmp = Float64(t_0 + Float64(Float64(F / Float64(B * fma(Float64(B * B), Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666), 1.0))) * Float64(fma(Float64(fma(2.0, x, 2.0) / Float64(F * F)), -0.5, 1.0) / F)));
      	elseif (x <= 1.8e-111)
      		tmp = Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(fma(F, F, 2.0))));
      	else
      		tmp = Float64(t_0 + Float64(Float64(F / Float64(B * fma(-0.16666666666666666, Float64(B * B), 1.0))) * Float64(-1.0 / F)));
      	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, -0.0066], N[(t$95$0 + N[(N[(F / N[(B * N[(N[(B * B), $MachinePrecision] * N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e-111], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(F / N[(B * N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x \cdot \frac{-1}{\tan B}\\
      \mathbf{if}\;x \leq -0.0066:\\
      \;\;\;\;t\_0 + \frac{F}{B \cdot \mathsf{fma}\left(B \cdot B, 0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, 1\right)} \cdot \frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, -0.5, 1\right)}{F}\\
      
      \mathbf{elif}\;x \leq 1.8 \cdot 10^{-111}:\\
      \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0 + \frac{F}{B \cdot \mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right)} \cdot \frac{-1}{F}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -0.0066

        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. Add Preprocessing
        3. Taylor expanded in F around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -0.0066 < x < 1.80000000000000005e-111

        1. Initial program 76.3%

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

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

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

          \[\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}} \]
        5. Taylor expanded in x around 0

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
          2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
          13. lift-fma.f6456.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.80000000000000005e-111 < x

        1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 9: 62.6% accurate, 2.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right)} \cdot \frac{-1}{F}\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{-103}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-111}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0
               (+
                (* x (/ -1.0 (tan B)))
                (* (/ F (* B (fma -0.16666666666666666 (* B B) 1.0))) (/ -1.0 F)))))
         (if (<= x -6.8e-103)
           t_0
           (if (<= x 1.8e-111) (* (/ F (sin B)) (/ 1.0 (sqrt (fma F F 2.0)))) t_0))))
      double code(double F, double B, double x) {
      	double t_0 = (x * (-1.0 / tan(B))) + ((F / (B * fma(-0.16666666666666666, (B * B), 1.0))) * (-1.0 / F));
      	double tmp;
      	if (x <= -6.8e-103) {
      		tmp = t_0;
      	} else if (x <= 1.8e-111) {
      		tmp = (F / sin(B)) * (1.0 / sqrt(fma(F, F, 2.0)));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / Float64(B * fma(-0.16666666666666666, Float64(B * B), 1.0))) * Float64(-1.0 / F)))
      	tmp = 0.0
      	if (x <= -6.8e-103)
      		tmp = t_0;
      	elseif (x <= 1.8e-111)
      		tmp = Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(fma(F, F, 2.0))));
      	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[(N[(F / N[(B * N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e-103], t$95$0, If[LessEqual[x, 1.8e-111], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right)} \cdot \frac{-1}{F}\\
      \mathbf{if}\;x \leq -6.8 \cdot 10^{-103}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x \leq 1.8 \cdot 10^{-111}:\\
      \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -6.80000000000000006e-103 or 1.80000000000000005e-111 < x

        1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

        if -6.80000000000000006e-103 < x < 1.80000000000000005e-111

        1. Initial program 74.4%

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

          \[\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}} \]
        5. Taylor expanded in x around 0

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
          2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
          13. lift-fma.f6462.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 10: 62.1% accurate, 2.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{-33}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 5.7 \cdot 10^{-155}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0 (+ (* x (/ -1.0 (tan B))) (* (/ F B) (/ -1.0 F)))))
         (if (<= x -7.5e-33)
           t_0
           (if (<= x 5.7e-155)
             (* (/ F (sin B)) (/ 1.0 (sqrt (fma F F 2.0))))
             (if (<= x 2.6e-7) (/ (- -1.0 x) (sin B)) t_0)))))
      double code(double F, double B, double x) {
      	double t_0 = (x * (-1.0 / tan(B))) + ((F / B) * (-1.0 / F));
      	double tmp;
      	if (x <= -7.5e-33) {
      		tmp = t_0;
      	} else if (x <= 5.7e-155) {
      		tmp = (F / sin(B)) * (1.0 / sqrt(fma(F, F, 2.0)));
      	} else if (x <= 2.6e-7) {
      		tmp = (-1.0 - x) / sin(B);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * Float64(-1.0 / F)))
      	tmp = 0.0
      	if (x <= -7.5e-33)
      		tmp = t_0;
      	elseif (x <= 5.7e-155)
      		tmp = Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(fma(F, F, 2.0))));
      	elseif (x <= 2.6e-7)
      		tmp = Float64(Float64(-1.0 - x) / sin(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[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e-33], t$95$0, If[LessEqual[x, 5.7e-155], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e-7], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\
      \mathbf{if}\;x \leq -7.5 \cdot 10^{-33}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x \leq 5.7 \cdot 10^{-155}:\\
      \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
      
      \mathbf{elif}\;x \leq 2.6 \cdot 10^{-7}:\\
      \;\;\;\;\frac{-1 - x}{\sin B}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -7.5000000000000001e-33 or 2.59999999999999999e-7 < x

        1. Initial program 94.4%

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

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

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

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

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

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

          if -7.5000000000000001e-33 < x < 5.69999999999999965e-155

          1. Initial program 77.7%

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

              \[\leadsto \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}} \]
          4. Applied rewrites81.2%

            \[\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}} \]
          5. Taylor expanded in x around 0

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

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
            2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
            13. lift-fma.f6461.3

              \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \]
          7. Applied rewrites61.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 5.69999999999999965e-155 < x < 2.59999999999999999e-7

          1. Initial program 46.0%

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

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

              \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
          5. Applied rewrites43.0%

            \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
          6. Taylor expanded in B around 0

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

              \[\leadsto -\frac{1 + x}{\sin B} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification72.0%

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

          Alternative 11: 65.7% accurate, 2.4× speedup?

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

            1. Initial program 59.9%

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

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

                \[\leadsto \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.1

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

              \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
            6. Taylor expanded in B around 0

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

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

              if -0.0045999999999999999 < F < -8.4000000000000005e-97

              1. Initial program 99.4%

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

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

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

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

                  \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
                13. lift-fma.f6457.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -8.4000000000000005e-97 < F < 1.45000000000000006e-151

              1. Initial program 99.3%

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

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

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

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

                \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
              7. Step-by-step derivation
                1. 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. lift-fma.f6445.7

                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
              8. Applied rewrites45.7%

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

                \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
              10. Step-by-step derivation
                1. Applied rewrites45.7%

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

                if 1.45000000000000006e-151 < F < 5.4999999999999996e-19

                1. Initial program 99.3%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. 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}} \]
                4. Applied rewrites99.1%

                  \[\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}} \]
                5. Taylor expanded in x around 0

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

                    \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                  2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
                  13. lift-fma.f6466.3

                    \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \]
                7. Applied rewrites66.3%

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

                  \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2}} \]
                9. Step-by-step derivation
                  1. Applied rewrites66.3%

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

                  if 5.4999999999999996e-19 < F

                  1. Initial program 75.1%

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

                    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                  4. 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.f6498.3

                      \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                  5. Applied rewrites98.3%

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0046:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{-97}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-151}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{\sin B}\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 12: 65.6% accurate, 2.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{0.5} \cdot F\\ \mathbf{if}\;F \leq -0.00034:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{-97}:\\ \;\;\;\;\frac{t\_0}{\sin B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-151}:\\ \;\;\;\;\frac{t\_0 - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{\sin B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (let* ((t_0 (* (sqrt 0.5) F)))
                     (if (<= F -0.00034)
                       (/ (- -1.0 x) (sin B))
                       (if (<= F -8.4e-97)
                         (/ t_0 (sin B))
                         (if (<= F 1.45e-151)
                           (/ (- t_0 x) B)
                           (if (<= F 5.5e-19)
                             (* (/ F (sin B)) (sqrt 0.5))
                             (/ (- 1.0 x) (sin B))))))))
                  double code(double F, double B, double x) {
                  	double t_0 = sqrt(0.5) * F;
                  	double tmp;
                  	if (F <= -0.00034) {
                  		tmp = (-1.0 - x) / sin(B);
                  	} else if (F <= -8.4e-97) {
                  		tmp = t_0 / sin(B);
                  	} else if (F <= 1.45e-151) {
                  		tmp = (t_0 - x) / B;
                  	} else if (F <= 5.5e-19) {
                  		tmp = (F / sin(B)) * sqrt(0.5);
                  	} else {
                  		tmp = (1.0 - x) / sin(B);
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(f, b, x)
                  use fmin_fmax_functions
                      real(8), intent (in) :: f
                      real(8), intent (in) :: b
                      real(8), intent (in) :: x
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = sqrt(0.5d0) * f
                      if (f <= (-0.00034d0)) then
                          tmp = ((-1.0d0) - x) / sin(b)
                      else if (f <= (-8.4d-97)) then
                          tmp = t_0 / sin(b)
                      else if (f <= 1.45d-151) then
                          tmp = (t_0 - x) / b
                      else if (f <= 5.5d-19) then
                          tmp = (f / sin(b)) * sqrt(0.5d0)
                      else
                          tmp = (1.0d0 - x) / sin(b)
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double F, double B, double x) {
                  	double t_0 = Math.sqrt(0.5) * F;
                  	double tmp;
                  	if (F <= -0.00034) {
                  		tmp = (-1.0 - x) / Math.sin(B);
                  	} else if (F <= -8.4e-97) {
                  		tmp = t_0 / Math.sin(B);
                  	} else if (F <= 1.45e-151) {
                  		tmp = (t_0 - x) / B;
                  	} else if (F <= 5.5e-19) {
                  		tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
                  	} else {
                  		tmp = (1.0 - x) / Math.sin(B);
                  	}
                  	return tmp;
                  }
                  
                  def code(F, B, x):
                  	t_0 = math.sqrt(0.5) * F
                  	tmp = 0
                  	if F <= -0.00034:
                  		tmp = (-1.0 - x) / math.sin(B)
                  	elif F <= -8.4e-97:
                  		tmp = t_0 / math.sin(B)
                  	elif F <= 1.45e-151:
                  		tmp = (t_0 - x) / B
                  	elif F <= 5.5e-19:
                  		tmp = (F / math.sin(B)) * math.sqrt(0.5)
                  	else:
                  		tmp = (1.0 - x) / math.sin(B)
                  	return tmp
                  
                  function code(F, B, x)
                  	t_0 = Float64(sqrt(0.5) * F)
                  	tmp = 0.0
                  	if (F <= -0.00034)
                  		tmp = Float64(Float64(-1.0 - x) / sin(B));
                  	elseif (F <= -8.4e-97)
                  		tmp = Float64(t_0 / sin(B));
                  	elseif (F <= 1.45e-151)
                  		tmp = Float64(Float64(t_0 - x) / B);
                  	elseif (F <= 5.5e-19)
                  		tmp = Float64(Float64(F / sin(B)) * sqrt(0.5));
                  	else
                  		tmp = Float64(Float64(1.0 - x) / sin(B));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(F, B, x)
                  	t_0 = sqrt(0.5) * F;
                  	tmp = 0.0;
                  	if (F <= -0.00034)
                  		tmp = (-1.0 - x) / sin(B);
                  	elseif (F <= -8.4e-97)
                  		tmp = t_0 / sin(B);
                  	elseif (F <= 1.45e-151)
                  		tmp = (t_0 - x) / B;
                  	elseif (F <= 5.5e-19)
                  		tmp = (F / sin(B)) * sqrt(0.5);
                  	else
                  		tmp = (1.0 - x) / sin(B);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision]}, If[LessEqual[F, -0.00034], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.4e-97], N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e-151], N[(N[(t$95$0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.5e-19], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sqrt{0.5} \cdot F\\
                  \mathbf{if}\;F \leq -0.00034:\\
                  \;\;\;\;\frac{-1 - x}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq -8.4 \cdot 10^{-97}:\\
                  \;\;\;\;\frac{t\_0}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 1.45 \cdot 10^{-151}:\\
                  \;\;\;\;\frac{t\_0 - x}{B}\\
                  
                  \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\
                  \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1 - x}{\sin B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 5 regimes
                  2. if F < -3.4e-4

                    1. Initial program 59.9%

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

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

                        \[\leadsto \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.1

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

                      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                    6. Taylor expanded in B around 0

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

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

                      if -3.4e-4 < F < -8.4000000000000005e-97

                      1. Initial program 99.4%

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

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

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

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

                          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                        2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
                        13. lift-fma.f6457.6

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

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

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

                          \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{\sin B} \]
                        2. sqrt-unprodN/A

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

                          \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{\sin B} \]
                        4. metadata-evalN/A

                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B} \]
                        5. metadata-evalN/A

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

                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B} \]
                        7. *-commutativeN/A

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

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

                          \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F}{\sin B} \]
                        10. metadata-evalN/A

                          \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F}{\sin B} \]
                        11. lift-sin.f6457.7

                          \[\leadsto \frac{\sqrt{0.5} \cdot F}{\sin B} \]
                      10. Applied rewrites57.7%

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

                      if -8.4000000000000005e-97 < F < 1.45000000000000006e-151

                      1. Initial program 99.3%

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

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

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

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

                        \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                      7. Step-by-step derivation
                        1. 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. lift-fma.f6445.7

                          \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                      8. Applied rewrites45.7%

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

                        \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                      10. Step-by-step derivation
                        1. Applied rewrites45.7%

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

                        if 1.45000000000000006e-151 < F < 5.4999999999999996e-19

                        1. Initial program 99.3%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Add Preprocessing
                        3. 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}} \]
                        4. Applied rewrites99.1%

                          \[\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}} \]
                        5. Taylor expanded in x around 0

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

                            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                          2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
                          13. lift-fma.f6466.3

                            \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \]
                        7. Applied rewrites66.3%

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

                          \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2}} \]
                        9. Step-by-step derivation
                          1. Applied rewrites66.3%

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

                          if 5.4999999999999996e-19 < F

                          1. Initial program 75.1%

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

                            \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                          4. 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.f6498.3

                              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                          5. Applied rewrites98.3%

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00034:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{-97}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-151}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{\sin B}\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 13: 65.6% accurate, 2.4× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{0.5} \cdot F\\ t_1 := \frac{t\_0}{\sin B}\\ \mathbf{if}\;F \leq -0.00034:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{-97}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-151}:\\ \;\;\;\;\frac{t\_0 - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{\sin B}\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (let* ((t_0 (* (sqrt 0.5) F)) (t_1 (/ t_0 (sin B))))
                             (if (<= F -0.00034)
                               (/ (- -1.0 x) (sin B))
                               (if (<= F -8.4e-97)
                                 t_1
                                 (if (<= F 1.45e-151)
                                   (/ (- t_0 x) B)
                                   (if (<= F 5.5e-19) t_1 (/ (- 1.0 x) (sin B))))))))
                          double code(double F, double B, double x) {
                          	double t_0 = sqrt(0.5) * F;
                          	double t_1 = t_0 / sin(B);
                          	double tmp;
                          	if (F <= -0.00034) {
                          		tmp = (-1.0 - x) / sin(B);
                          	} else if (F <= -8.4e-97) {
                          		tmp = t_1;
                          	} else if (F <= 1.45e-151) {
                          		tmp = (t_0 - x) / B;
                          	} else if (F <= 5.5e-19) {
                          		tmp = t_1;
                          	} else {
                          		tmp = (1.0 - x) / sin(B);
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(f, b, x)
                          use fmin_fmax_functions
                              real(8), intent (in) :: f
                              real(8), intent (in) :: b
                              real(8), intent (in) :: x
                              real(8) :: t_0
                              real(8) :: t_1
                              real(8) :: tmp
                              t_0 = sqrt(0.5d0) * f
                              t_1 = t_0 / sin(b)
                              if (f <= (-0.00034d0)) then
                                  tmp = ((-1.0d0) - x) / sin(b)
                              else if (f <= (-8.4d-97)) then
                                  tmp = t_1
                              else if (f <= 1.45d-151) then
                                  tmp = (t_0 - x) / b
                              else if (f <= 5.5d-19) then
                                  tmp = t_1
                              else
                                  tmp = (1.0d0 - x) / sin(b)
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double F, double B, double x) {
                          	double t_0 = Math.sqrt(0.5) * F;
                          	double t_1 = t_0 / Math.sin(B);
                          	double tmp;
                          	if (F <= -0.00034) {
                          		tmp = (-1.0 - x) / Math.sin(B);
                          	} else if (F <= -8.4e-97) {
                          		tmp = t_1;
                          	} else if (F <= 1.45e-151) {
                          		tmp = (t_0 - x) / B;
                          	} else if (F <= 5.5e-19) {
                          		tmp = t_1;
                          	} else {
                          		tmp = (1.0 - x) / Math.sin(B);
                          	}
                          	return tmp;
                          }
                          
                          def code(F, B, x):
                          	t_0 = math.sqrt(0.5) * F
                          	t_1 = t_0 / math.sin(B)
                          	tmp = 0
                          	if F <= -0.00034:
                          		tmp = (-1.0 - x) / math.sin(B)
                          	elif F <= -8.4e-97:
                          		tmp = t_1
                          	elif F <= 1.45e-151:
                          		tmp = (t_0 - x) / B
                          	elif F <= 5.5e-19:
                          		tmp = t_1
                          	else:
                          		tmp = (1.0 - x) / math.sin(B)
                          	return tmp
                          
                          function code(F, B, x)
                          	t_0 = Float64(sqrt(0.5) * F)
                          	t_1 = Float64(t_0 / sin(B))
                          	tmp = 0.0
                          	if (F <= -0.00034)
                          		tmp = Float64(Float64(-1.0 - x) / sin(B));
                          	elseif (F <= -8.4e-97)
                          		tmp = t_1;
                          	elseif (F <= 1.45e-151)
                          		tmp = Float64(Float64(t_0 - x) / B);
                          	elseif (F <= 5.5e-19)
                          		tmp = t_1;
                          	else
                          		tmp = Float64(Float64(1.0 - x) / sin(B));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(F, B, x)
                          	t_0 = sqrt(0.5) * F;
                          	t_1 = t_0 / sin(B);
                          	tmp = 0.0;
                          	if (F <= -0.00034)
                          		tmp = (-1.0 - x) / sin(B);
                          	elseif (F <= -8.4e-97)
                          		tmp = t_1;
                          	elseif (F <= 1.45e-151)
                          		tmp = (t_0 - x) / B;
                          	elseif (F <= 5.5e-19)
                          		tmp = t_1;
                          	else
                          		tmp = (1.0 - x) / sin(B);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00034], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.4e-97], t$95$1, If[LessEqual[F, 1.45e-151], N[(N[(t$95$0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.5e-19], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := \sqrt{0.5} \cdot F\\
                          t_1 := \frac{t\_0}{\sin B}\\
                          \mathbf{if}\;F \leq -0.00034:\\
                          \;\;\;\;\frac{-1 - x}{\sin B}\\
                          
                          \mathbf{elif}\;F \leq -8.4 \cdot 10^{-97}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;F \leq 1.45 \cdot 10^{-151}:\\
                          \;\;\;\;\frac{t\_0 - x}{B}\\
                          
                          \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1 - x}{\sin B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if F < -3.4e-4

                            1. Initial program 59.9%

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

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

                                \[\leadsto \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.1

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

                              \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                            6. Taylor expanded in B around 0

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

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

                              if -3.4e-4 < F < -8.4000000000000005e-97 or 1.45000000000000006e-151 < F < 5.4999999999999996e-19

                              1. Initial program 99.3%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Add Preprocessing
                              3. 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}} \]
                              4. Applied rewrites99.3%

                                \[\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}} \]
                              5. Taylor expanded in x around 0

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

                                  \[\leadsto \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}} \]
                                2. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{F}{\sin B} \cdot \sqrt{{\left(F \cdot F + 2\right)}^{-1}} \]
                                13. lift-fma.f6462.1

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

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

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

                                  \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{\sin B} \]
                                2. sqrt-unprodN/A

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

                                  \[\leadsto \frac{F \cdot \sqrt{-1 \cdot \frac{-1}{2}}}{\sin B} \]
                                4. metadata-evalN/A

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B} \]
                                5. metadata-evalN/A

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

                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B} \]
                                7. *-commutativeN/A

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

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

                                  \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F}{\sin B} \]
                                10. metadata-evalN/A

                                  \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F}{\sin B} \]
                                11. lift-sin.f6462.0

                                  \[\leadsto \frac{\sqrt{0.5} \cdot F}{\sin B} \]
                              10. Applied rewrites62.0%

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

                              if -8.4000000000000005e-97 < F < 1.45000000000000006e-151

                              1. Initial program 99.3%

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

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

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

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

                                \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                              7. Step-by-step derivation
                                1. 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. lift-fma.f6445.7

                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                              8. Applied rewrites45.7%

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

                                \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                              10. Step-by-step derivation
                                1. Applied rewrites45.7%

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

                                if 5.4999999999999996e-19 < F

                                1. Initial program 75.1%

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

                                  \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                4. 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.f6498.3

                                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                5. Applied rewrites98.3%

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

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

                                    \[\leadsto \frac{1 - x}{\sin B} \]
                                8. Recombined 4 regimes into one program.
                                9. Final simplification63.8%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00034:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{-97}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-151}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{\sin B}\\ \end{array} \]
                                10. Add Preprocessing

                                Alternative 14: 52.6% accurate, 2.8× speedup?

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

                                  1. Initial program 57.7%

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

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

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

                                    \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                                  6. Taylor expanded in x around 0

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

                                      \[\leadsto \frac{-1}{\sin B} \]
                                    2. lift-sin.f6461.0

                                      \[\leadsto \frac{-1}{\sin B} \]
                                  8. Applied rewrites61.0%

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

                                  if -5.5e17 < F < 6.4999999999999996e23

                                  1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                    11. lift-fma.f6443.8

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

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

                                  if 6.4999999999999996e23 < F < 2.5500000000000001e79

                                  1. Initial program 99.7%

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

                                    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                  4. 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} \]
                                  5. Applied rewrites99.7%

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

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

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

                                    if 2.5500000000000001e79 < F

                                    1. Initial program 63.4%

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

                                      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                    4. 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} \]
                                    5. Applied rewrites99.7%

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

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

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

                                        \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                                    8. Applied rewrites63.1%

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

                                  Alternative 15: 65.5% accurate, 2.9× speedup?

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

                                    1. Initial program 60.4%

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

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

                                        \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
                                    5. Applied rewrites98.0%

                                      \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                                    6. Taylor expanded in B around 0

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

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

                                      if -3.3999999999999999e-11 < F < 5.0000000000000004e-19

                                      1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                        11. lift-fma.f6443.3

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

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

                                      if 5.0000000000000004e-19 < F

                                      1. Initial program 75.5%

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

                                        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                      4. 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.f6496.9

                                          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                      5. Applied rewrites96.9%

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.4 \cdot 10^{-11}:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-19}:\\ \;\;\;\;\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 - x}{\sin B}\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 16: 59.1% accurate, 2.9× speedup?

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

                                        1. Initial program 57.7%

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

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

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

                                          \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                                        6. Taylor expanded in x around 0

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

                                            \[\leadsto \frac{-1}{\sin B} \]
                                          2. lift-sin.f6461.0

                                            \[\leadsto \frac{-1}{\sin B} \]
                                        8. Applied rewrites61.0%

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

                                        if -5.5e17 < F < 5.0000000000000004e-19

                                        1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                          11. lift-fma.f6443.3

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

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

                                        if 5.0000000000000004e-19 < F

                                        1. Initial program 75.5%

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

                                          \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                        4. 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.f6496.9

                                            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                        5. Applied rewrites96.9%

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

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

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

                                        Alternative 17: 51.6% accurate, 3.1× speedup?

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

                                          1. Initial program 57.7%

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

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

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

                                            \[\leadsto \color{blue}{-\frac{1 + \cos B \cdot x}{\sin B}} \]
                                          6. Taylor expanded in x around 0

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

                                              \[\leadsto \frac{-1}{\sin B} \]
                                            2. lift-sin.f6461.0

                                              \[\leadsto \frac{-1}{\sin B} \]
                                          8. Applied rewrites61.0%

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

                                          if -5.5e17 < F < 5.4999999999999996e-19

                                          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                            11. lift-fma.f6443.0

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

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

                                          if 5.4999999999999996e-19 < F

                                          1. Initial program 75.1%

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

                                            \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                          4. 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.f6498.3

                                              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                          5. Applied rewrites98.3%

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

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

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

                                              \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                                          8. Applied rewrites54.7%

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

                                        Alternative 18: 50.7% accurate, 5.7× speedup?

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

                                          1. Initial program 60.4%

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

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

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

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

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

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

                                            if -3.3999999999999999e-11 < F < 5.4999999999999996e-19

                                            1. Initial program 99.3%

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

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

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

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

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

                                                \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                              5. unpow-1N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                              6. lower-/.f64N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + F \cdot F\right) + 2}} \cdot F - x}{B} \]
                                              7. pow2N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                              8. associate-+r+N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                              9. pow2N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left(F \cdot F + 2\right)}} \cdot F - x}{B} \]
                                              10. lift-fma.f64N/A

                                                \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                              11. lift-fma.f6443.0

                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                            7. Applied rewrites43.0%

                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]

                                            if 5.4999999999999996e-19 < F

                                            1. Initial program 75.1%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in F around inf

                                              \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                            4. 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.f6498.3

                                                \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                            5. Applied rewrites98.3%

                                              \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
                                            6. Taylor expanded in B around 0

                                              \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{\color{blue}{B}} \]
                                            7. Step-by-step derivation
                                              1. metadata-evalN/A

                                                \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                                              2. lower-/.f64N/A

                                                \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                                            8. Applied rewrites54.7%

                                              \[\leadsto \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), 1\right) - x}{\color{blue}{B}} \]
                                          8. Recombined 3 regimes into one program.
                                          9. Add Preprocessing

                                          Alternative 19: 50.2% accurate, 7.1× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.6 \cdot 10^{+30}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\ \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), 1\right) - x}{B}\\ \end{array} \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= F -6.6e+30)
                                             (/ (- -1.0 x) B)
                                             (if (<= F 5.5e-19)
                                               (/ (- (* (sqrt 0.5) F) x) B)
                                               (/
                                                (- (fma (* B B) (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))) 1.0) x)
                                                B))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -6.6e+30) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else if (F <= 5.5e-19) {
                                          		tmp = ((sqrt(0.5) * F) - x) / B;
                                          	} else {
                                          		tmp = (fma((B * B), fma(0.5, x, (0.16666666666666666 * (1.0 - x))), 1.0) - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= -6.6e+30)
                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                          	elseif (F <= 5.5e-19)
                                          		tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B);
                                          	else
                                          		tmp = Float64(Float64(fma(Float64(B * B), fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))), 1.0) - x) / B);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, -6.6e+30], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.5e-19], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq -6.6 \cdot 10^{+30}:\\
                                          \;\;\;\;\frac{-1 - x}{B}\\
                                          
                                          \mathbf{elif}\;F \leq 5.5 \cdot 10^{-19}:\\
                                          \;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), 1\right) - x}{B}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if F < -6.60000000000000053e30

                                            1. Initial program 55.3%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in B around 0

                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            4. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                            5. Applied rewrites25.7%

                                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                            6. Taylor expanded in F around -inf

                                              \[\leadsto \frac{-1 - x}{B} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites45.3%

                                                \[\leadsto \frac{-1 - x}{B} \]

                                              if -6.60000000000000053e30 < F < 5.4999999999999996e-19

                                              1. Initial program 99.3%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in B around 0

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              4. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              5. Applied rewrites42.5%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              6. Taylor expanded in F around 0

                                                \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                              7. Step-by-step derivation
                                                1. 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. lift-fma.f6442.6

                                                  \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                              8. Applied rewrites42.6%

                                                \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                              9. Taylor expanded in x around 0

                                                \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                              10. Step-by-step derivation
                                                1. Applied rewrites42.5%

                                                  \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                                if 5.4999999999999996e-19 < F

                                                1. Initial program 75.1%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in F around inf

                                                  \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                                4. 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.f6498.3

                                                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                                5. Applied rewrites98.3%

                                                  \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
                                                6. Taylor expanded in B around 0

                                                  \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{\color{blue}{B}} \]
                                                7. Step-by-step derivation
                                                  1. metadata-evalN/A

                                                    \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                                                  2. lower-/.f64N/A

                                                    \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                                                8. Applied rewrites54.7%

                                                  \[\leadsto \frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), 1\right) - x}{\color{blue}{B}} \]
                                              11. Recombined 3 regimes into one program.
                                              12. Add Preprocessing

                                              Alternative 20: 50.4% accurate, 8.8× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.6 \cdot 10^{+30}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9000000000000:\\ \;\;\;\;\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 -6.6e+30)
                                                 (/ (- -1.0 x) B)
                                                 (if (<= F 9000000000000.0) (/ (- (* (sqrt 0.5) F) x) B) (/ (- 1.0 x) B))))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -6.6e+30) {
                                              		tmp = (-1.0 - x) / B;
                                              	} else if (F <= 9000000000000.0) {
                                              		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 <= (-6.6d+30)) then
                                                      tmp = ((-1.0d0) - x) / b
                                                  else if (f <= 9000000000000.0d0) 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 <= -6.6e+30) {
                                              		tmp = (-1.0 - x) / B;
                                              	} else if (F <= 9000000000000.0) {
                                              		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 <= -6.6e+30:
                                              		tmp = (-1.0 - x) / B
                                              	elif F <= 9000000000000.0:
                                              		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 <= -6.6e+30)
                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                              	elseif (F <= 9000000000000.0)
                                              		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 <= -6.6e+30)
                                              		tmp = (-1.0 - x) / B;
                                              	elseif (F <= 9000000000000.0)
                                              		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, -6.6e+30], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9000000000000.0], 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 -6.6 \cdot 10^{+30}:\\
                                              \;\;\;\;\frac{-1 - x}{B}\\
                                              
                                              \mathbf{elif}\;F \leq 9000000000000:\\
                                              \;\;\;\;\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 < -6.60000000000000053e30

                                                1. Initial program 55.3%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in B around 0

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                4. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                5. Applied rewrites25.7%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                6. Taylor expanded in F around -inf

                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites45.3%

                                                    \[\leadsto \frac{-1 - x}{B} \]

                                                  if -6.60000000000000053e30 < F < 9e12

                                                  1. Initial program 99.4%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                  5. Applied rewrites42.9%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                  6. Taylor expanded in F around 0

                                                    \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. 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. lift-fma.f6443.0

                                                      \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                                  8. Applied rewrites43.0%

                                                    \[\leadsto \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B} \]
                                                  9. Taylor expanded in x around 0

                                                    \[\leadsto \frac{\sqrt{\frac{1}{2}} \cdot F - x}{B} \]
                                                  10. Step-by-step derivation
                                                    1. Applied rewrites42.9%

                                                      \[\leadsto \frac{\sqrt{0.5} \cdot F - x}{B} \]

                                                    if 9e12 < F

                                                    1. Initial program 72.5%

                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    4. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                    5. Applied rewrites41.7%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                    6. Taylor expanded in F around inf

                                                      \[\leadsto \frac{1 - x}{B} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites53.9%

                                                        \[\leadsto \frac{1 - x}{B} \]
                                                    8. Recombined 3 regimes into one program.
                                                    9. Add Preprocessing

                                                    Alternative 21: 44.5% accurate, 13.6× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.95 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-65}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                    (FPCore (F B x)
                                                     :precision binary64
                                                     (if (<= F -1.95e-13)
                                                       (/ (- -1.0 x) B)
                                                       (if (<= F 2e-65) (/ (- x) B) (/ (- 1.0 x) B))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -1.95e-13) {
                                                    		tmp = (-1.0 - x) / B;
                                                    	} else if (F <= 2e-65) {
                                                    		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.95d-13)) then
                                                            tmp = ((-1.0d0) - x) / b
                                                        else if (f <= 2d-65) 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.95e-13) {
                                                    		tmp = (-1.0 - x) / B;
                                                    	} else if (F <= 2e-65) {
                                                    		tmp = -x / B;
                                                    	} else {
                                                    		tmp = (1.0 - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(F, B, x):
                                                    	tmp = 0
                                                    	if F <= -1.95e-13:
                                                    		tmp = (-1.0 - x) / B
                                                    	elif F <= 2e-65:
                                                    		tmp = -x / B
                                                    	else:
                                                    		tmp = (1.0 - x) / B
                                                    	return tmp
                                                    
                                                    function code(F, B, x)
                                                    	tmp = 0.0
                                                    	if (F <= -1.95e-13)
                                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                                    	elseif (F <= 2e-65)
                                                    		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.95e-13)
                                                    		tmp = (-1.0 - x) / B;
                                                    	elseif (F <= 2e-65)
                                                    		tmp = -x / B;
                                                    	else
                                                    		tmp = (1.0 - x) / B;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[F_, B_, x_] := If[LessEqual[F, -1.95e-13], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2e-65], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;F \leq -1.95 \cdot 10^{-13}:\\
                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                    
                                                    \mathbf{elif}\;F \leq 2 \cdot 10^{-65}:\\
                                                    \;\;\;\;\frac{-x}{B}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{1 - x}{B}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if F < -1.95000000000000002e-13

                                                      1. Initial program 60.4%

                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in B around 0

                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                      4. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                      5. Applied rewrites27.0%

                                                        \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                      6. Taylor expanded in F around -inf

                                                        \[\leadsto \frac{-1 - x}{B} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites44.4%

                                                          \[\leadsto \frac{-1 - x}{B} \]

                                                        if -1.95000000000000002e-13 < F < 1.99999999999999985e-65

                                                        1. Initial program 99.3%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in B around 0

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-/.f64N/A

                                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                        5. Applied rewrites43.1%

                                                          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                        6. Taylor expanded in F around 0

                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                        7. Step-by-step derivation
                                                          1. mul-1-negN/A

                                                            \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                          2. lower-neg.f6430.4

                                                            \[\leadsto \frac{-x}{B} \]
                                                        8. Applied rewrites30.4%

                                                          \[\leadsto \frac{-x}{B} \]

                                                        if 1.99999999999999985e-65 < F

                                                        1. Initial program 78.5%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in B around 0

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-/.f64N/A

                                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                        5. Applied rewrites42.6%

                                                          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                        6. Taylor expanded in F around inf

                                                          \[\leadsto \frac{1 - x}{B} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites47.0%

                                                            \[\leadsto \frac{1 - x}{B} \]
                                                        8. Recombined 3 regimes into one program.
                                                        9. Add Preprocessing

                                                        Alternative 22: 37.5% accurate, 17.5× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.95 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                        (FPCore (F B x)
                                                         :precision binary64
                                                         (if (<= F -1.95e-13) (/ (- -1.0 x) B) (/ (- x) B)))
                                                        double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -1.95e-13) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else {
                                                        		tmp = -x / B;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        module fmin_fmax_functions
                                                            implicit none
                                                            private
                                                            public fmax
                                                            public fmin
                                                        
                                                            interface fmax
                                                                module procedure fmax88
                                                                module procedure fmax44
                                                                module procedure fmax84
                                                                module procedure fmax48
                                                            end interface
                                                            interface fmin
                                                                module procedure fmin88
                                                                module procedure fmin44
                                                                module procedure fmin84
                                                                module procedure fmin48
                                                            end interface
                                                        contains
                                                            real(8) function fmax88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmax44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmin44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                            end function
                                                        end module
                                                        
                                                        real(8) function code(f, b, x)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: f
                                                            real(8), intent (in) :: b
                                                            real(8), intent (in) :: x
                                                            real(8) :: tmp
                                                            if (f <= (-1.95d-13)) then
                                                                tmp = ((-1.0d0) - x) / b
                                                            else
                                                                tmp = -x / b
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -1.95e-13) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else {
                                                        		tmp = -x / B;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(F, B, x):
                                                        	tmp = 0
                                                        	if F <= -1.95e-13:
                                                        		tmp = (-1.0 - x) / B
                                                        	else:
                                                        		tmp = -x / B
                                                        	return tmp
                                                        
                                                        function code(F, B, x)
                                                        	tmp = 0.0
                                                        	if (F <= -1.95e-13)
                                                        		tmp = Float64(Float64(-1.0 - x) / B);
                                                        	else
                                                        		tmp = Float64(Float64(-x) / B);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(F, B, x)
                                                        	tmp = 0.0;
                                                        	if (F <= -1.95e-13)
                                                        		tmp = (-1.0 - x) / B;
                                                        	else
                                                        		tmp = -x / B;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[F_, B_, x_] := If[LessEqual[F, -1.95e-13], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;F \leq -1.95 \cdot 10^{-13}:\\
                                                        \;\;\;\;\frac{-1 - x}{B}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\frac{-x}{B}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if F < -1.95000000000000002e-13

                                                          1. Initial program 60.4%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in B around 0

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                          5. Applied rewrites27.0%

                                                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                          6. Taylor expanded in F around -inf

                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites44.4%

                                                              \[\leadsto \frac{-1 - x}{B} \]

                                                            if -1.95000000000000002e-13 < F

                                                            1. Initial program 90.9%

                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in B around 0

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            4. Step-by-step derivation
                                                              1. lower-/.f64N/A

                                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                            5. Applied rewrites42.9%

                                                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                            6. Taylor expanded in F around 0

                                                              \[\leadsto \frac{-1 \cdot x}{B} \]
                                                            7. Step-by-step derivation
                                                              1. mul-1-negN/A

                                                                \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                              2. lower-neg.f6429.4

                                                                \[\leadsto \frac{-x}{B} \]
                                                            8. Applied rewrites29.4%

                                                              \[\leadsto \frac{-x}{B} \]
                                                          8. Recombined 2 regimes into one program.
                                                          9. Add Preprocessing

                                                          Alternative 23: 30.2% accurate, 26.3× speedup?

                                                          \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                          (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                          double code(double F, double B, double x) {
                                                          	return -x / B;
                                                          }
                                                          
                                                          module fmin_fmax_functions
                                                              implicit none
                                                              private
                                                              public fmax
                                                              public fmin
                                                          
                                                              interface fmax
                                                                  module procedure fmax88
                                                                  module procedure fmax44
                                                                  module procedure fmax84
                                                                  module procedure fmax48
                                                              end interface
                                                              interface fmin
                                                                  module procedure fmin88
                                                                  module procedure fmin44
                                                                  module procedure fmin84
                                                                  module procedure fmin48
                                                              end interface
                                                          contains
                                                              real(8) function fmax88(x, y) result (res)
                                                                  real(8), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                              end function
                                                              real(4) function fmax44(x, y) result (res)
                                                                  real(4), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmax84(x, y) result(res)
                                                                  real(8), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmax48(x, y) result(res)
                                                                  real(4), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmin88(x, y) result (res)
                                                                  real(8), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                              end function
                                                              real(4) function fmin44(x, y) result (res)
                                                                  real(4), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmin84(x, y) result(res)
                                                                  real(8), intent (in) :: x
                                                                  real(4), intent (in) :: y
                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                              end function
                                                              real(8) function fmin48(x, y) result(res)
                                                                  real(4), intent (in) :: x
                                                                  real(8), intent (in) :: y
                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                              end function
                                                          end module
                                                          
                                                          real(8) function code(f, b, x)
                                                          use fmin_fmax_functions
                                                              real(8), intent (in) :: f
                                                              real(8), intent (in) :: b
                                                              real(8), intent (in) :: x
                                                              code = -x / b
                                                          end function
                                                          
                                                          public static double code(double F, double B, double x) {
                                                          	return -x / B;
                                                          }
                                                          
                                                          def code(F, B, x):
                                                          	return -x / B
                                                          
                                                          function code(F, B, x)
                                                          	return Float64(Float64(-x) / B)
                                                          end
                                                          
                                                          function tmp = code(F, B, x)
                                                          	tmp = -x / B;
                                                          end
                                                          
                                                          code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \frac{-x}{B}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Initial program 81.6%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in B around 0

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                          5. Applied rewrites38.0%

                                                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                          6. Taylor expanded in F around 0

                                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                                          7. Step-by-step derivation
                                                            1. mul-1-negN/A

                                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                            2. lower-neg.f6425.0

                                                              \[\leadsto \frac{-x}{B} \]
                                                          8. Applied rewrites25.0%

                                                            \[\leadsto \frac{-x}{B} \]
                                                          9. Add Preprocessing

                                                          Reproduce

                                                          ?
                                                          herbie shell --seed 2025050 
                                                          (FPCore (F B x)
                                                            :name "VandenBroeck and Keller, Equation (23)"
                                                            :precision binary64
                                                            :pre (TRUE)
                                                            (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))