VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.2% → 99.7%
Time: 9.2s
Alternatives: 29
Speedup: 1.5×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 29 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.2% 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.2× speedup?

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

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

\mathbf{elif}\;F \leq 10000000000:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\


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

    1. Initial program 59.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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
      10. 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)}} \]
      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 rewrites75.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 F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e31 < F < 1e10

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1e10 < F

    1. Initial program 66.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}{\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.6

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

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

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

Alternative 2: 99.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, \cos B, 1\right)}{-\sin B}\\ \mathbf{elif}\;F \leq 280000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \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} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.6e+14)
   (/ (fma x (cos B) 1.0) (- (sin B)))
   (if (<= F 280000000.0)
     (+ (* x (/ -1.0 (tan B))) (* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0)))))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.6e+14) {
		tmp = fma(x, cos(B), 1.0) / -sin(B);
	} else if (F <= 280000000.0) {
		tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0))));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.6e+14)
		tmp = Float64(fma(x, cos(B), 1.0) / Float64(-sin(B)));
	elseif (F <= 280000000.0)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0)))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -5.6e+14], N[(N[(x * N[Cos[B], $MachinePrecision] + 1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 280000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 280000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \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}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.6e14

    1. Initial program 60.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. 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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
      10. 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)}} \]
      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 rewrites76.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 F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.6e14 < F < 2.8e8

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 2.8e8 < F

    1. Initial program 66.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}{\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.6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, \cos B, 1\right)}{-\sin B}\\ \mathbf{elif}\;F \leq 280000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \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 3: 99.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \cos B, 1\right)}{-\sin B}\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{F \cdot \sqrt{0.5}}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\


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

    1. Initial program 63.6%

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

        \[\leadsto \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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
      10. 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)}} \]
      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 rewrites77.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 F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.3999999999999999

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.3999999999999999 < F

      1. Initial program 68.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.f6497.3

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

        \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
    12. Recombined 3 regimes into one program.
    13. Final simplification98.3%

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

    Alternative 4: 91.9% accurate, 1.4× speedup?

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

      1. Initial program 63.6%

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

          \[\leadsto \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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
        10. 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)}} \]
        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 rewrites77.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 F around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -60 < F < 10200

      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
        11. lower-+.f6481.6

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

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

      if 10200 < F

      1. Initial program 67.8%

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

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

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

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

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

    Alternative 5: 86.1% accurate, 1.4× speedup?

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

      1. Initial program 60.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. 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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
        10. 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)}} \]
        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 rewrites76.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 F around -inf

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

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

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

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

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

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

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

        if -2.75e14 < F < 10200

        1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 10200 < F

        1. Initial program 67.8%

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

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

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

          \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
      10. Recombined 3 regimes into one program.
      11. Final simplification84.7%

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

      Alternative 6: 77.2% accurate, 1.5× speedup?

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

        1. Initial program 90.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 x around inf

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

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

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

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

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

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

            \[\leadsto \left(-\frac{\cos B}{\sin B}\right) \cdot x \]
          5. lift-/.f6493.1

            \[\leadsto \left(-\frac{\cos B}{\sin B}\right) \cdot x \]
        7. Applied rewrites93.1%

          \[\leadsto \left(-\frac{\cos B}{\sin B}\right) \cdot x \]

        if -1.90000000000000001e-51 < x < 3.2000000000000002e-32

        1. Initial program 79.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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
          10. 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)}} \]
          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.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 B around 0

          \[\leadsto \left(-\color{blue}{\frac{x}{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. Step-by-step derivation
          1. lower-/.f6467.0

            \[\leadsto \left(-\frac{x}{\color{blue}{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 rewrites67.0%

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

        if 3.2000000000000002e-32 < x

        1. Initial program 83.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 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.f6491.0

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

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

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

      Alternative 7: 77.2% accurate, 1.5× speedup?

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

        1. Initial program 86.2%

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

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

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

        if -3.2000000000000001e-53 < x < 3.2000000000000002e-32

        1. Initial program 79.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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
          10. 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)}} \]
          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.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 B around 0

          \[\leadsto \left(-\color{blue}{\frac{x}{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. Step-by-step derivation
          1. lower-/.f6467.0

            \[\leadsto \left(-\frac{x}{\color{blue}{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 rewrites67.0%

          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification78.7%

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

      Alternative 8: 73.4% accurate, 1.4× speedup?

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

        1. Initial program 60.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. 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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
          10. 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)}} \]
          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 rewrites76.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 F around -inf

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

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

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

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

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

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

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

          if -2.75e14 < F < 1.01999999999999994e-241

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.01999999999999994e-241 < F < 2.05000000000000002e133

          1. Initial program 97.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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
            10. 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)}} \]
            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.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. Taylor expanded in B around 0

            \[\leadsto \left(-\color{blue}{\frac{x}{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. Step-by-step derivation
            1. lower-/.f6483.1

              \[\leadsto \left(-\frac{x}{\color{blue}{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 rewrites83.1%

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

          if 2.05000000000000002e133 < F

          1. Initial program 47.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-/.f6488.0

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{-x}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
              10. lift-tan.f6460.4

                \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
            3. Applied rewrites60.4%

              \[\leadsto \color{blue}{\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}} \]
          8. Recombined 4 regimes into one program.
          9. Final simplification78.7%

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

          Alternative 9: 73.4% accurate, 1.6× speedup?

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

            1. Initial program 60.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. 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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
              10. 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)}} \]
              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 rewrites76.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 F around -inf

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

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

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

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

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

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

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

              if -2.75e14 < F < 11200

              1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 11200 < F < 3.40000000000000025e210

              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. 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-/.f6492.9

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{B \cdot \color{blue}{\left(1 + \frac{1}{3} \cdot {B}^{2}\right)}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                2. fp-cancel-sign-sub-invN/A

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{B \cdot \left(1 - \frac{-1}{3} \cdot \left(B \cdot \color{blue}{B}\right)\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                7. lower-*.f6479.0

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

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

              if 3.40000000000000025e210 < F

              1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{-x}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                  10. lift-tan.f6461.3

                    \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                3. Applied rewrites61.3%

                  \[\leadsto \color{blue}{\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}} \]
              8. Recombined 4 regimes into one program.
              9. Final simplification77.2%

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

              Alternative 10: 73.2% accurate, 1.6× speedup?

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

                1. Initial program 60.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. 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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
                  10. 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)}} \]
                  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 rewrites76.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 F around -inf

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

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

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

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

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

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

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

                  if -2.75e14 < F < 11200

                  1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, F \cdot F + 2\right)}} \]
                    11. lift-fma.f6481.4

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

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

                  if 11200 < F < 3.40000000000000025e210

                  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. 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-/.f6492.9

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{B \cdot \color{blue}{\left(1 + \frac{1}{3} \cdot {B}^{2}\right)}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                    2. fp-cancel-sign-sub-invN/A

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{B \cdot \left(1 - \frac{-1}{3} \cdot \left(B \cdot \color{blue}{B}\right)\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                    7. lower-*.f6479.0

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

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

                  if 3.40000000000000025e210 < F

                  1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{-x}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                      10. lift-tan.f6461.3

                        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                    3. Applied rewrites61.3%

                      \[\leadsto \color{blue}{\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}} \]
                  8. Recombined 4 regimes into one program.
                  9. Final simplification77.2%

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

                  Alternative 11: 73.2% accurate, 1.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 0.72:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\ \;\;\;\;x \cdot \frac{-1}{B \cdot \left(1 - -0.3333333333333333 \cdot \left(B \cdot B\right)\right)} + \frac{F}{\sin B} \cdot \frac{1}{F}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -70000.0)
                     (/ (- -1.0 x) (sin B))
                     (if (<= F 0.72)
                       (+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (+ x x))))))
                       (if (<= F 3.4e+210)
                         (+
                          (* x (/ -1.0 (* B (- 1.0 (* -0.3333333333333333 (* B B))))))
                          (* (/ F (sin B)) (/ 1.0 F)))
                         (+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F)))))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -70000.0) {
                  		tmp = (-1.0 - x) / sin(B);
                  	} else if (F <= 0.72) {
                  		tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x)))));
                  	} else if (F <= 3.4e+210) {
                  		tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / sin(B)) * (1.0 / F));
                  	} else {
                  		tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
                  	}
                  	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 <= (-70000.0d0)) then
                          tmp = ((-1.0d0) - x) / sin(b)
                      else if (f <= 0.72d0) then
                          tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * sqrt((1.0d0 / (2.0d0 + (x + x)))))
                      else if (f <= 3.4d+210) then
                          tmp = (x * ((-1.0d0) / (b * (1.0d0 - ((-0.3333333333333333d0) * (b * b)))))) + ((f / sin(b)) * (1.0d0 / f))
                      else
                          tmp = (-x / tan(b)) + ((f / b) * (1.0d0 / f))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -70000.0) {
                  		tmp = (-1.0 - x) / Math.sin(B);
                  	} else if (F <= 0.72) {
                  		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * Math.sqrt((1.0 / (2.0 + (x + x)))));
                  	} else if (F <= 3.4e+210) {
                  		tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / Math.sin(B)) * (1.0 / F));
                  	} else {
                  		tmp = (-x / Math.tan(B)) + ((F / B) * (1.0 / F));
                  	}
                  	return tmp;
                  }
                  
                  def code(F, B, x):
                  	tmp = 0
                  	if F <= -70000.0:
                  		tmp = (-1.0 - x) / math.sin(B)
                  	elif F <= 0.72:
                  		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * math.sqrt((1.0 / (2.0 + (x + x)))))
                  	elif F <= 3.4e+210:
                  		tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / math.sin(B)) * (1.0 / F))
                  	else:
                  		tmp = (-x / math.tan(B)) + ((F / B) * (1.0 / F))
                  	return tmp
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -70000.0)
                  		tmp = Float64(Float64(-1.0 - x) / sin(B));
                  	elseif (F <= 0.72)
                  		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x + x))))));
                  	elseif (F <= 3.4e+210)
                  		tmp = Float64(Float64(x * Float64(-1.0 / Float64(B * Float64(1.0 - Float64(-0.3333333333333333 * Float64(B * B)))))) + Float64(Float64(F / sin(B)) * Float64(1.0 / F)));
                  	else
                  		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(F, B, x)
                  	tmp = 0.0;
                  	if (F <= -70000.0)
                  		tmp = (-1.0 - x) / sin(B);
                  	elseif (F <= 0.72)
                  		tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x)))));
                  	elseif (F <= 3.4e+210)
                  		tmp = (x * (-1.0 / (B * (1.0 - (-0.3333333333333333 * (B * B)))))) + ((F / sin(B)) * (1.0 / F));
                  	else
                  		tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.72], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+210], N[(N[(x * N[(-1.0 / N[(B * N[(1.0 - N[(-0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -70000:\\
                  \;\;\;\;\frac{-1 - x}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 0.72:\\
                  \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\
                  
                  \mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\
                  \;\;\;\;x \cdot \frac{-1}{B \cdot \left(1 - -0.3333333333333333 \cdot \left(B \cdot B\right)\right)} + \frac{F}{\sin B} \cdot \frac{1}{F}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if F < -7e4

                    1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

                      if -7e4 < F < 0.71999999999999997

                      1. Initial program 99.5%

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

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

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

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

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

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

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

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} \]
                          4. count-2-revN/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}} \]
                          5. lower-+.f6481.0

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}} \]
                        4. Applied rewrites81.0%

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

                        if 0.71999999999999997 < F < 3.40000000000000025e210

                        1. Initial program 78.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-/.f6490.4

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

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

                            \[\leadsto \left(-x \cdot \frac{1}{B \cdot \color{blue}{\left(1 + \frac{1}{3} \cdot {B}^{2}\right)}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                          2. fp-cancel-sign-sub-invN/A

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

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

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

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

                            \[\leadsto \left(-x \cdot \frac{1}{B \cdot \left(1 - \frac{-1}{3} \cdot \left(B \cdot \color{blue}{B}\right)\right)}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                          7. lower-*.f6477.0

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

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

                        if 3.40000000000000025e210 < F

                        1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\frac{-x}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                            10. lift-tan.f6461.3

                              \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                          3. Applied rewrites61.3%

                            \[\leadsto \color{blue}{\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}} \]
                        8. Recombined 4 regimes into one program.
                        9. Final simplification76.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 0.72:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\ \;\;\;\;x \cdot \frac{-1}{B \cdot \left(1 - -0.3333333333333333 \cdot \left(B \cdot B\right)\right)} + \frac{F}{\sin B} \cdot \frac{1}{F}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 12: 72.9% accurate, 1.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 0.72:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (<= F -70000.0)
                           (/ (- -1.0 x) (sin B))
                           (if (<= F 0.72)
                             (+ (* x (/ -1.0 (tan B))) (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (+ x x))))))
                             (if (<= F 3.4e+210)
                               (+ (- (/ x B)) (* (/ F (sin B)) (/ 1.0 F)))
                               (+ (/ (- x) (tan B)) (* (/ F B) (/ 1.0 F)))))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -70000.0) {
                        		tmp = (-1.0 - x) / sin(B);
                        	} else if (F <= 0.72) {
                        		tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x)))));
                        	} else if (F <= 3.4e+210) {
                        		tmp = -(x / B) + ((F / sin(B)) * (1.0 / F));
                        	} else {
                        		tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
                        	}
                        	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 <= (-70000.0d0)) then
                                tmp = ((-1.0d0) - x) / sin(b)
                            else if (f <= 0.72d0) then
                                tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) * sqrt((1.0d0 / (2.0d0 + (x + x)))))
                            else if (f <= 3.4d+210) then
                                tmp = -(x / b) + ((f / sin(b)) * (1.0d0 / f))
                            else
                                tmp = (-x / tan(b)) + ((f / b) * (1.0d0 / f))
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -70000.0) {
                        		tmp = (-1.0 - x) / Math.sin(B);
                        	} else if (F <= 0.72) {
                        		tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) * Math.sqrt((1.0 / (2.0 + (x + x)))));
                        	} else if (F <= 3.4e+210) {
                        		tmp = -(x / B) + ((F / Math.sin(B)) * (1.0 / F));
                        	} else {
                        		tmp = (-x / Math.tan(B)) + ((F / B) * (1.0 / F));
                        	}
                        	return tmp;
                        }
                        
                        def code(F, B, x):
                        	tmp = 0
                        	if F <= -70000.0:
                        		tmp = (-1.0 - x) / math.sin(B)
                        	elif F <= 0.72:
                        		tmp = (x * (-1.0 / math.tan(B))) + ((F / B) * math.sqrt((1.0 / (2.0 + (x + x)))))
                        	elif F <= 3.4e+210:
                        		tmp = -(x / B) + ((F / math.sin(B)) * (1.0 / F))
                        	else:
                        		tmp = (-x / math.tan(B)) + ((F / B) * (1.0 / F))
                        	return tmp
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if (F <= -70000.0)
                        		tmp = Float64(Float64(-1.0 - x) / sin(B));
                        	elseif (F <= 0.72)
                        		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x + x))))));
                        	elseif (F <= 3.4e+210)
                        		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(1.0 / F)));
                        	else
                        		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * Float64(1.0 / F)));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(F, B, x)
                        	tmp = 0.0;
                        	if (F <= -70000.0)
                        		tmp = (-1.0 - x) / sin(B);
                        	elseif (F <= 0.72)
                        		tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt((1.0 / (2.0 + (x + x)))));
                        	elseif (F <= 3.4e+210)
                        		tmp = -(x / B) + ((F / sin(B)) * (1.0 / F));
                        	else
                        		tmp = (-x / tan(B)) + ((F / B) * (1.0 / F));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.72], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e+210], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;F \leq -70000:\\
                        \;\;\;\;\frac{-1 - x}{\sin B}\\
                        
                        \mathbf{elif}\;F \leq 0.72:\\
                        \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\
                        
                        \mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\
                        \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if F < -7e4

                          1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

                            if -7e4 < F < 0.71999999999999997

                            1. Initial program 99.5%

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

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

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

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

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

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} \]
                                4. count-2-revN/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}} \]
                                5. lower-+.f6481.0

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}} \]
                              4. Applied rewrites81.0%

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

                              if 0.71999999999999997 < F < 3.40000000000000025e210

                              1. Initial program 78.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-/.f6490.4

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

                                \[\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(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                              7. Step-by-step derivation
                                1. lower-/.f6477.0

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

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

                              if 3.40000000000000025e210 < F

                              1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{-x}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                                  10. lift-tan.f6461.3

                                    \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                                3. Applied rewrites61.3%

                                  \[\leadsto \color{blue}{\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}} \]
                              8. Recombined 4 regimes into one program.
                              9. Final simplification76.7%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{\sin B}\\ \mathbf{elif}\;F \leq 0.72:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(x + x\right)}}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{+210}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 13: 60.6% accurate, 1.9× speedup?

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

                                1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                  15. lower-fma.f6453.9

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

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

                                if 3.4999999999999997e-5 < B < 1e15

                                1. Initial program 67.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{F \cdot F + 2}} \cdot F}{\color{blue}{\sin B}} \]
                                7. Applied rewrites50.0%

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

                                if 1e15 < B

                                1. Initial program 88.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}{F}} \]
                                4. Step-by-step derivation
                                  1. lower-/.f6456.1

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{\frac{-x}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                                    10. lift-tan.f6454.0

                                      \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                                  3. Applied rewrites54.0%

                                    \[\leadsto \color{blue}{\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}} \]
                                8. Recombined 3 regimes into one program.
                                9. Final simplification53.8%

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

                                Alternative 14: 59.5% accurate, 1.8× speedup?

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

                                  1. Initial program 81.1%

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

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

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

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

                                  if 0.640000000000000013 < B

                                  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-/.f6455.0

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{\frac{-x}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                                      10. lift-tan.f6450.6

                                        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{F}{B} \cdot \frac{1}{F} \]
                                    3. Applied rewrites50.6%

                                      \[\leadsto \color{blue}{\frac{-x}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}} \]
                                  8. Recombined 2 regimes into one program.
                                  9. Final simplification53.1%

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

                                  Alternative 15: 59.0% accurate, 1.8× speedup?

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

                                    1. Initial program 63.0%

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

                                        \[\leadsto \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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                      9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
                                      10. 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)}} \]
                                      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 rewrites77.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 F around -inf

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

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

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

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

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

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

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

                                      if -520 < F < -2.00000000000000004e-87

                                      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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\sqrt{\frac{1}{F \cdot F + 2}} \cdot F}{\color{blue}{\sin B}} \]
                                      7. Applied rewrites59.3%

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

                                      if -2.00000000000000004e-87 < F < 8.4999999999999996e-142

                                      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                        15. lower-fma.f6453.5

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

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

                                      if 8.4999999999999996e-142 < F < 1e7

                                      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 1e7 < F

                                      1. Initial program 67.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-/.f6490.3

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\color{blue}{F}} \]
                                      5. Applied rewrites90.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(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                                      7. Step-by-step derivation
                                        1. lower-/.f6464.1

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

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

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

                                    Alternative 16: 56.4% accurate, 2.4× speedup?

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

                                      1. Initial program 63.6%

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

                                          \[\leadsto \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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
                                        10. 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)}} \]
                                        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 rewrites77.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 F around -inf

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

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

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

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

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

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

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

                                        if -0.56000000000000005 < F < -2.00000000000000004e-87

                                        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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{\sin B} \]
                                          12. lift-sin.f6455.6

                                            \[\leadsto \frac{F \cdot \sqrt{0.5}}{\sin B} \]
                                        8. Applied rewrites55.6%

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

                                        if -2.00000000000000004e-87 < F < 1.20000000000000007e44

                                        1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if 1.20000000000000007e44 < F

                                        1. Initial program 65.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{1}{\sin B} \]
                                          2. lift-sin.f6454.2

                                            \[\leadsto \frac{1}{\sin B} \]
                                        8. Applied rewrites54.2%

                                          \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                      10. Recombined 4 regimes into one program.
                                      11. Final simplification57.2%

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

                                      Alternative 17: 56.3% accurate, 2.2× speedup?

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

                                        1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                          15. lower-fma.f6453.9

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

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

                                        if 3.4999999999999997e-5 < B

                                        1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\sqrt{\frac{1}{F \cdot F + 2}} \cdot F}{\color{blue}{\sin B}} \]
                                        7. Applied rewrites34.7%

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

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

                                      Alternative 18: 52.2% accurate, 2.2× speedup?

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

                                        1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                          15. lower-fma.f6453.9

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

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

                                        if 3.4999999999999997e-5 < B

                                        1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 19: 51.5% accurate, 2.6× speedup?

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

                                        1. Initial program 63.6%

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

                                            \[\leadsto \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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
                                          10. 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)}} \]
                                          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 rewrites77.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 F around -inf

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

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

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

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

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

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

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

                                          if -60 < F < 1.20000000000000007e44

                                          1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                            15. lower-fma.f6449.3

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

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

                                          if 1.20000000000000007e44 < F

                                          1. Initial program 65.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{1}{\sin B} \]
                                            2. lift-sin.f6454.2

                                              \[\leadsto \frac{1}{\sin B} \]
                                          8. Applied rewrites54.2%

                                            \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                        10. Recombined 3 regimes into one program.
                                        11. Final simplification55.5%

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

                                        Alternative 20: 51.3% accurate, 2.4× speedup?

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

                                          1. Initial program 37.0%

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

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

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

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

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

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

                                            if -9.00000000000000044e170 < F < -2.75e14

                                            1. Initial program 84.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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
                                              10. 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)}} \]
                                              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 rewrites88.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 F around -inf

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

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

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

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

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

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

                                                \[\leadsto \frac{-1}{\sin B} \]
                                              2. lift-sin.f6471.7

                                                \[\leadsto \frac{-1}{\sin B} \]
                                            10. Applied rewrites71.7%

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

                                            if -2.75e14 < F < 1.20000000000000007e44

                                            1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                              15. lower-fma.f6449.4

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

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

                                            if 1.20000000000000007e44 < F

                                            1. Initial program 65.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{1}{\sin B} \]
                                              2. lift-sin.f6454.2

                                                \[\leadsto \frac{1}{\sin B} \]
                                            8. Applied rewrites54.2%

                                              \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                          8. Recombined 4 regimes into one program.
                                          9. Final simplification53.5%

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

                                          Alternative 21: 51.3% accurate, 2.9× speedup?

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

                                            1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                              15. lower-fma.f6453.9

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

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

                                            if 3.4999999999999997e-5 < B

                                            1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{1}{\sin B} \]
                                              2. lift-sin.f6419.7

                                                \[\leadsto \frac{1}{\sin B} \]
                                            8. Applied rewrites19.7%

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

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

                                          Alternative 22: 51.2% accurate, 3.5× speedup?

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

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

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

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

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

                                              if -78 < F < 4e53

                                              1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{\frac{1}{\sqrt{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F - x}{B} \]
                                                9. lower-sqrt.f64N/A

                                                  \[\leadsto \frac{\frac{1}{\sqrt{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F - x}{B} \]
                                                10. pow2N/A

                                                  \[\leadsto \frac{\frac{1}{\sqrt{\left({F}^{2} + \left(x + x\right)\right) + 2}} \cdot F - x}{B} \]
                                                11. count-2-revN/A

                                                  \[\leadsto \frac{\frac{1}{\sqrt{\left({F}^{2} + 2 \cdot x\right) + 2}} \cdot F - x}{B} \]
                                                12. associate-+l+N/A

                                                  \[\leadsto \frac{\frac{1}{\sqrt{{F}^{2} + \left(2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                                13. pow2N/A

                                                  \[\leadsto \frac{\frac{1}{\sqrt{F \cdot F + \left(2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                                14. lower-fma.f64N/A

                                                  \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2 \cdot x + 2\right)}} \cdot F - x}{B} \]
                                                15. lower-fma.f6449.0

                                                  \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B} \]
                                              7. Applied rewrites49.0%

                                                \[\leadsto \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B} \]

                                              if 4e53 < F

                                              1. Initial program 64.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 rewrites29.7%

                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                              6. Taylor expanded in F around inf

                                                \[\leadsto \frac{1 - x}{B} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites40.2%

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              8. Recombined 3 regimes into one program.
                                              9. Final simplification45.9%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -78:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{+53}:\\ \;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                              10. Add Preprocessing

                                              Alternative 23: 51.1% accurate, 3.8× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.75:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                              (FPCore (F B x)
                                               :precision binary64
                                               (if (<= F -70000.0)
                                                 (/ (- -1.0 x) B)
                                                 (if (<= F 1.75)
                                                   (/ (- (* F (sqrt (/ 1.0 (fma 2.0 x 2.0)))) x) B)
                                                   (/ (- (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) 1.0) x) B))))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -70000.0) {
                                              		tmp = (-1.0 - x) / B;
                                              	} else if (F <= 1.75) {
                                              		tmp = ((F * sqrt((1.0 / fma(2.0, x, 2.0)))) - x) / B;
                                              	} else {
                                              		tmp = (fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), 1.0) - x) / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(F, B, x)
                                              	tmp = 0.0
                                              	if (F <= -70000.0)
                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                              	elseif (F <= 1.75)
                                              		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / fma(2.0, x, 2.0)))) - x) / B);
                                              	else
                                              		tmp = Float64(Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), 1.0) - x) / B);
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.75], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;F \leq -70000:\\
                                              \;\;\;\;\frac{-1 - x}{B}\\
                                              
                                              \mathbf{elif}\;F \leq 1.75:\\
                                              \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if F < -7e4

                                                1. Initial program 61.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 rewrites32.7%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                6. Taylor expanded in F around -inf

                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites45.7%

                                                    \[\leadsto \frac{-1 - x}{B} \]

                                                  if -7e4 < F < 1.75

                                                  1. Initial program 99.5%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                  5. Applied rewrites47.6%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                  6. Taylor expanded in F around -inf

                                                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. metadata-evalN/A

                                                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                    2. lower--.f64N/A

                                                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                    3. associate-*r/N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    4. lower-/.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    5. lower-*.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    6. metadata-evalN/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    7. lower-+.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    8. count-2-revN/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    9. lift-+.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    10. pow2N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                    11. lower-*.f643.2

                                                      \[\leadsto \frac{\left(\frac{0.5 \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                  8. Applied rewrites3.2%

                                                    \[\leadsto \frac{\left(\frac{0.5 \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                  9. Taylor expanded in F around 0

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                  10. Step-by-step derivation
                                                    1. lower-*.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                    2. lower-sqrt.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                    3. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                    4. +-commutativeN/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 \cdot x + 2}} - x}{B} \]
                                                    5. lower-fma.f6446.9

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B} \]
                                                  11. Applied rewrites46.9%

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B} \]

                                                  if 1.75 < F

                                                  1. Initial program 68.7%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                  5. Applied rewrites33.9%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                  6. Taylor expanded in F around -inf

                                                    \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. metadata-evalN/A

                                                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                    2. lower--.f64N/A

                                                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                    3. associate-*r/N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    4. lower-/.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    5. lower-*.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    6. metadata-evalN/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    7. lower-+.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    8. count-2-revN/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    9. lift-+.f64N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                    10. pow2N/A

                                                      \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                    11. lower-*.f6421.1

                                                      \[\leadsto \frac{\left(\frac{0.5 \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                  8. Applied rewrites21.1%

                                                    \[\leadsto \frac{\left(\frac{0.5 \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                  9. Taylor expanded in F around inf

                                                    \[\leadsto \frac{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                                  10. Step-by-step derivation
                                                    1. +-commutativeN/A

                                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} + 1\right) - x}{B} \]
                                                    2. div-addN/A

                                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                                    3. metadata-evalN/A

                                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(\frac{2 \cdot 1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                                    4. associate-*r/N/A

                                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                                    5. associate-*r/N/A

                                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                                    6. +-commutativeN/A

                                                      \[\leadsto \frac{\left(\frac{-1}{2} \cdot \left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}\right) + 1\right) - x}{B} \]
                                                    7. lower-fma.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, 1\right) - x}{B} \]
                                                    8. +-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, 2 \cdot \frac{1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                                    9. associate-*r/N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot 1}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                                    10. metadata-evalN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + 2 \cdot \frac{x}{{F}^{2}}, 1\right) - x}{B} \]
                                                    11. associate-*r/N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2}{{F}^{2}} + \frac{2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                                    12. div-addN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                                    13. lower-/.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 + 2 \cdot x}{{F}^{2}}, 1\right) - x}{B} \]
                                                    14. +-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{2 \cdot x + 2}{{F}^{2}}, 1\right) - x}{B} \]
                                                    15. lower-fma.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{{F}^{2}}, 1\right) - x}{B} \]
                                                    16. pow2N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                                    17. lift-*.f6442.4

                                                      \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                                  11. Applied rewrites42.4%

                                                    \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                                                8. Recombined 3 regimes into one program.
                                                9. Final simplification45.3%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.75:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B}\\ \end{array} \]
                                                10. Add Preprocessing

                                                Alternative 24: 51.1% accurate, 4.2× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \end{array} \]
                                                (FPCore (F B x)
                                                 :precision binary64
                                                 (if (<= F -70000.0)
                                                   (/ (- -1.0 x) B)
                                                   (if (<= F 1.7)
                                                     (/ (- (* F (sqrt (/ 1.0 (fma 2.0 x 2.0)))) x) B)
                                                     (/ (- (* (/ 1.0 F) F) x) B))))
                                                double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -70000.0) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else if (F <= 1.7) {
                                                		tmp = ((F * sqrt((1.0 / fma(2.0, x, 2.0)))) - x) / B;
                                                	} else {
                                                		tmp = (((1.0 / F) * F) - x) / B;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(F, B, x)
                                                	tmp = 0.0
                                                	if (F <= -70000.0)
                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                	elseif (F <= 1.7)
                                                		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / fma(2.0, x, 2.0)))) - x) / B);
                                                	else
                                                		tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B);
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;F \leq -70000:\\
                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                
                                                \mathbf{elif}\;F \leq 1.7:\\
                                                \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 3 regimes
                                                2. if F < -7e4

                                                  1. Initial program 61.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 rewrites32.7%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                  6. Taylor expanded in F around -inf

                                                    \[\leadsto \frac{-1 - x}{B} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites45.7%

                                                      \[\leadsto \frac{-1 - x}{B} \]

                                                    if -7e4 < F < 1.69999999999999996

                                                    1. Initial program 99.5%

                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    4. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                    5. Applied rewrites47.6%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    6. Taylor expanded in F around -inf

                                                      \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                    7. Step-by-step derivation
                                                      1. metadata-evalN/A

                                                        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                      2. lower--.f64N/A

                                                        \[\leadsto \frac{\left(\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - 1\right) - x}{B} \]
                                                      3. associate-*r/N/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                      4. lower-/.f64N/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                      5. lower-*.f64N/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                      6. metadata-evalN/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                      7. lower-+.f64N/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + 2 \cdot x\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                      8. count-2-revN/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                      9. lift-+.f64N/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{{F}^{2}} - 1\right) - x}{B} \]
                                                      10. pow2N/A

                                                        \[\leadsto \frac{\left(\frac{\frac{1}{2} \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                      11. lower-*.f643.2

                                                        \[\leadsto \frac{\left(\frac{0.5 \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                    8. Applied rewrites3.2%

                                                      \[\leadsto \frac{\left(\frac{0.5 \cdot \left(2 + \left(x + x\right)\right)}{F \cdot F} - 1\right) - x}{B} \]
                                                    9. Taylor expanded in F around 0

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                    10. Step-by-step derivation
                                                      1. lower-*.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                      2. lower-sqrt.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                      3. lower-/.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B} \]
                                                      4. +-commutativeN/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 \cdot x + 2}} - x}{B} \]
                                                      5. lower-fma.f6446.9

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B} \]
                                                    11. Applied rewrites46.9%

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B} \]

                                                    if 1.69999999999999996 < F

                                                    1. Initial program 68.7%

                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in B around 0

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    4. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                    5. Applied rewrites33.9%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    6. Taylor expanded in F around inf

                                                      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                    7. Step-by-step derivation
                                                      1. lift-/.f6442.2

                                                        \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                    8. Applied rewrites42.2%

                                                      \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                  8. Recombined 3 regimes into one program.
                                                  9. Final simplification45.2%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \]
                                                  10. Add Preprocessing

                                                  Alternative 25: 47.9% accurate, 5.0× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.35:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \end{array} \]
                                                  (FPCore (F B x)
                                                   :precision binary64
                                                   (if (<= F -70000.0)
                                                     (/ (- -1.0 x) B)
                                                     (if (<= F 1.35)
                                                       (fma (/ F B) (sqrt 0.5) (/ (- x) B))
                                                       (/ (- (* (/ 1.0 F) F) x) B))))
                                                  double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (F <= -70000.0) {
                                                  		tmp = (-1.0 - x) / B;
                                                  	} else if (F <= 1.35) {
                                                  		tmp = fma((F / B), sqrt(0.5), (-x / B));
                                                  	} else {
                                                  		tmp = (((1.0 / F) * F) - x) / B;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(F, B, x)
                                                  	tmp = 0.0
                                                  	if (F <= -70000.0)
                                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                                  	elseif (F <= 1.35)
                                                  		tmp = fma(Float64(F / B), sqrt(0.5), Float64(Float64(-x) / B));
                                                  	else
                                                  		tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[F_, B_, x_] := If[LessEqual[F, -70000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.35], N[(N[(F / B), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;F \leq -70000:\\
                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                  
                                                  \mathbf{elif}\;F \leq 1.35:\\
                                                  \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if F < -7e4

                                                    1. Initial program 61.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 rewrites32.7%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    6. Taylor expanded in F around -inf

                                                      \[\leadsto \frac{-1 - x}{B} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites45.7%

                                                        \[\leadsto \frac{-1 - x}{B} \]

                                                      if -7e4 < F < 1.3500000000000001

                                                      1. Initial program 99.5%

                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in B around 0

                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                      4. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                      5. Applied rewrites47.6%

                                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \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.f6431.6

                                                          \[\leadsto \frac{-x}{B} \]
                                                      8. Applied rewrites31.6%

                                                        \[\leadsto \frac{-x}{B} \]
                                                      9. Taylor expanded in F around 0

                                                        \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                                      10. Step-by-step derivation
                                                        1. +-commutativeN/A

                                                          \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \color{blue}{\frac{x}{B}} \]
                                                        2. lower-fma.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                                        3. lower-/.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                                        4. lower-sqrt.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                                        5. lower-/.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 + 2 \cdot x}}, -1 \cdot \frac{x}{B}\right) \]
                                                        6. +-commutativeN/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2 \cdot x + 2}}, -1 \cdot \frac{x}{B}\right) \]
                                                        7. lower-fma.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, -1 \cdot \frac{x}{B}\right) \]
                                                        8. associate-*r/N/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-1 \cdot x}{B}\right) \]
                                                        9. mul-1-negN/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{\mathsf{neg}\left(x\right)}{B}\right) \]
                                                        10. lift-neg.f64N/A

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                                        11. lower-/.f6446.8

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                                      11. Applied rewrites46.8%

                                                        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}}, \frac{-x}{B}\right) \]
                                                      12. Taylor expanded in x around 0

                                                        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2}}, \frac{-x}{B}\right) \]
                                                      13. Step-by-step derivation
                                                        1. Applied rewrites46.8%

                                                          \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right) \]

                                                        if 1.3500000000000001 < F

                                                        1. Initial program 68.7%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in B around 0

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-/.f64N/A

                                                            \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                        5. Applied rewrites33.9%

                                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                        6. Taylor expanded in F around inf

                                                          \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                        7. Step-by-step derivation
                                                          1. lift-/.f6442.2

                                                            \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                        8. Applied rewrites42.2%

                                                          \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                      14. Recombined 3 regimes into one program.
                                                      15. Final simplification45.2%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -70000:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.35:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{0.5}, \frac{-x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \]
                                                      16. Add Preprocessing

                                                      Alternative 26: 44.2% accurate, 5.5× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \end{array} \]
                                                      (FPCore (F B x)
                                                       :precision binary64
                                                       (if (<= F -2.8e-75)
                                                         (/ (- -1.0 x) B)
                                                         (if (<= F 3.6e-47) (/ (- x) B) (/ (- (* (/ 1.0 F) F) x) B))))
                                                      double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= -2.8e-75) {
                                                      		tmp = (-1.0 - x) / B;
                                                      	} else if (F <= 3.6e-47) {
                                                      		tmp = -x / B;
                                                      	} else {
                                                      		tmp = (((1.0 / F) * F) - x) / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      module fmin_fmax_functions
                                                          implicit none
                                                          private
                                                          public fmax
                                                          public fmin
                                                      
                                                          interface fmax
                                                              module procedure fmax88
                                                              module procedure fmax44
                                                              module procedure fmax84
                                                              module procedure fmax48
                                                          end interface
                                                          interface fmin
                                                              module procedure fmin88
                                                              module procedure fmin44
                                                              module procedure fmin84
                                                              module procedure fmin48
                                                          end interface
                                                      contains
                                                          real(8) function fmax88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmax44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmin44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                          end function
                                                      end module
                                                      
                                                      real(8) function code(f, b, x)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: f
                                                          real(8), intent (in) :: b
                                                          real(8), intent (in) :: x
                                                          real(8) :: tmp
                                                          if (f <= (-2.8d-75)) then
                                                              tmp = ((-1.0d0) - x) / b
                                                          else if (f <= 3.6d-47) then
                                                              tmp = -x / b
                                                          else
                                                              tmp = (((1.0d0 / f) * f) - x) / b
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= -2.8e-75) {
                                                      		tmp = (-1.0 - x) / B;
                                                      	} else if (F <= 3.6e-47) {
                                                      		tmp = -x / B;
                                                      	} else {
                                                      		tmp = (((1.0 / F) * F) - x) / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(F, B, x):
                                                      	tmp = 0
                                                      	if F <= -2.8e-75:
                                                      		tmp = (-1.0 - x) / B
                                                      	elif F <= 3.6e-47:
                                                      		tmp = -x / B
                                                      	else:
                                                      		tmp = (((1.0 / F) * F) - x) / B
                                                      	return tmp
                                                      
                                                      function code(F, B, x)
                                                      	tmp = 0.0
                                                      	if (F <= -2.8e-75)
                                                      		tmp = Float64(Float64(-1.0 - x) / B);
                                                      	elseif (F <= 3.6e-47)
                                                      		tmp = Float64(Float64(-x) / B);
                                                      	else
                                                      		tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(F, B, x)
                                                      	tmp = 0.0;
                                                      	if (F <= -2.8e-75)
                                                      		tmp = (-1.0 - x) / B;
                                                      	elseif (F <= 3.6e-47)
                                                      		tmp = -x / B;
                                                      	else
                                                      		tmp = (((1.0 / F) * F) - x) / B;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[F_, B_, x_] := If[LessEqual[F, -2.8e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e-47], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\
                                                      \;\;\;\;\frac{-1 - x}{B}\\
                                                      
                                                      \mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\
                                                      \;\;\;\;\frac{-x}{B}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 3 regimes
                                                      2. if F < -2.79999999999999998e-75

                                                        1. Initial program 72.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 rewrites32.4%

                                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                        6. Taylor expanded in F around -inf

                                                          \[\leadsto \frac{-1 - x}{B} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites36.8%

                                                            \[\leadsto \frac{-1 - x}{B} \]

                                                          if -2.79999999999999998e-75 < F < 3.59999999999999991e-47

                                                          1. Initial program 99.5%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in B around 0

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                          5. Applied rewrites50.3%

                                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \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.f6437.5

                                                              \[\leadsto \frac{-x}{B} \]
                                                          8. Applied rewrites37.5%

                                                            \[\leadsto \frac{-x}{B} \]

                                                          if 3.59999999999999991e-47 < F

                                                          1. Initial program 71.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 rewrites35.9%

                                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                          6. Taylor expanded in F around inf

                                                            \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                          7. Step-by-step derivation
                                                            1. lift-/.f6439.2

                                                              \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                          8. Applied rewrites39.2%

                                                            \[\leadsto \frac{\frac{1}{F} \cdot F - x}{B} \]
                                                        8. Recombined 3 regimes into one program.
                                                        9. Final simplification37.8%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\ \end{array} \]
                                                        10. Add Preprocessing

                                                        Alternative 27: 44.2% accurate, 7.9× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                        (FPCore (F B x)
                                                         :precision binary64
                                                         (if (<= F -2.8e-75)
                                                           (/ (- -1.0 x) B)
                                                           (if (<= F 3.6e-47) (/ (- x) B) (/ (- 1.0 x) B))))
                                                        double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -2.8e-75) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else if (F <= 3.6e-47) {
                                                        		tmp = -x / B;
                                                        	} else {
                                                        		tmp = (1.0 - x) / B;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        module fmin_fmax_functions
                                                            implicit none
                                                            private
                                                            public fmax
                                                            public fmin
                                                        
                                                            interface fmax
                                                                module procedure fmax88
                                                                module procedure fmax44
                                                                module procedure fmax84
                                                                module procedure fmax48
                                                            end interface
                                                            interface fmin
                                                                module procedure fmin88
                                                                module procedure fmin44
                                                                module procedure fmin84
                                                                module procedure fmin48
                                                            end interface
                                                        contains
                                                            real(8) function fmax88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmax44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmin44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                            end function
                                                        end module
                                                        
                                                        real(8) function code(f, b, x)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: f
                                                            real(8), intent (in) :: b
                                                            real(8), intent (in) :: x
                                                            real(8) :: tmp
                                                            if (f <= (-2.8d-75)) then
                                                                tmp = ((-1.0d0) - x) / b
                                                            else if (f <= 3.6d-47) then
                                                                tmp = -x / b
                                                            else
                                                                tmp = (1.0d0 - x) / b
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -2.8e-75) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else if (F <= 3.6e-47) {
                                                        		tmp = -x / B;
                                                        	} else {
                                                        		tmp = (1.0 - x) / B;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(F, B, x):
                                                        	tmp = 0
                                                        	if F <= -2.8e-75:
                                                        		tmp = (-1.0 - x) / B
                                                        	elif F <= 3.6e-47:
                                                        		tmp = -x / B
                                                        	else:
                                                        		tmp = (1.0 - x) / B
                                                        	return tmp
                                                        
                                                        function code(F, B, x)
                                                        	tmp = 0.0
                                                        	if (F <= -2.8e-75)
                                                        		tmp = Float64(Float64(-1.0 - x) / B);
                                                        	elseif (F <= 3.6e-47)
                                                        		tmp = Float64(Float64(-x) / B);
                                                        	else
                                                        		tmp = Float64(Float64(1.0 - x) / B);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(F, B, x)
                                                        	tmp = 0.0;
                                                        	if (F <= -2.8e-75)
                                                        		tmp = (-1.0 - x) / B;
                                                        	elseif (F <= 3.6e-47)
                                                        		tmp = -x / B;
                                                        	else
                                                        		tmp = (1.0 - x) / B;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[F_, B_, x_] := If[LessEqual[F, -2.8e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e-47], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\
                                                        \;\;\;\;\frac{-1 - x}{B}\\
                                                        
                                                        \mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\
                                                        \;\;\;\;\frac{-x}{B}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\frac{1 - x}{B}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 3 regimes
                                                        2. if F < -2.79999999999999998e-75

                                                          1. Initial program 72.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 rewrites32.4%

                                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                          6. Taylor expanded in F around -inf

                                                            \[\leadsto \frac{-1 - x}{B} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites36.8%

                                                              \[\leadsto \frac{-1 - x}{B} \]

                                                            if -2.79999999999999998e-75 < F < 3.59999999999999991e-47

                                                            1. Initial program 99.5%

                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in B around 0

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            4. Step-by-step derivation
                                                              1. lower-/.f64N/A

                                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                            5. Applied rewrites50.3%

                                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \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.f6437.5

                                                                \[\leadsto \frac{-x}{B} \]
                                                            8. Applied rewrites37.5%

                                                              \[\leadsto \frac{-x}{B} \]

                                                            if 3.59999999999999991e-47 < F

                                                            1. Initial program 71.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 rewrites35.9%

                                                              \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                            6. Taylor expanded in F around inf

                                                              \[\leadsto \frac{1 - x}{B} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites39.2%

                                                                \[\leadsto \frac{1 - x}{B} \]
                                                            8. Recombined 3 regimes into one program.
                                                            9. Final simplification37.8%

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                            10. Add Preprocessing

                                                            Alternative 28: 37.0% accurate, 10.7× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                            (FPCore (F B x)
                                                             :precision binary64
                                                             (if (<= F -2.8e-75) (/ (- -1.0 x) B) (/ (- x) B)))
                                                            double code(double F, double B, double x) {
                                                            	double tmp;
                                                            	if (F <= -2.8e-75) {
                                                            		tmp = (-1.0 - x) / B;
                                                            	} else {
                                                            		tmp = -x / B;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            module fmin_fmax_functions
                                                                implicit none
                                                                private
                                                                public fmax
                                                                public fmin
                                                            
                                                                interface fmax
                                                                    module procedure fmax88
                                                                    module procedure fmax44
                                                                    module procedure fmax84
                                                                    module procedure fmax48
                                                                end interface
                                                                interface fmin
                                                                    module procedure fmin88
                                                                    module procedure fmin44
                                                                    module procedure fmin84
                                                                    module procedure fmin48
                                                                end interface
                                                            contains
                                                                real(8) function fmax88(x, y) result (res)
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                end function
                                                                real(4) function fmax44(x, y) result (res)
                                                                    real(4), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmax84(x, y) result(res)
                                                                    real(8), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmax48(x, y) result(res)
                                                                    real(4), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin88(x, y) result (res)
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                end function
                                                                real(4) function fmin44(x, y) result (res)
                                                                    real(4), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin84(x, y) result(res)
                                                                    real(8), intent (in) :: x
                                                                    real(4), intent (in) :: y
                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                end function
                                                                real(8) function fmin48(x, y) result(res)
                                                                    real(4), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                end function
                                                            end module
                                                            
                                                            real(8) function code(f, b, x)
                                                            use fmin_fmax_functions
                                                                real(8), intent (in) :: f
                                                                real(8), intent (in) :: b
                                                                real(8), intent (in) :: x
                                                                real(8) :: tmp
                                                                if (f <= (-2.8d-75)) then
                                                                    tmp = ((-1.0d0) - x) / b
                                                                else
                                                                    tmp = -x / b
                                                                end if
                                                                code = tmp
                                                            end function
                                                            
                                                            public static double code(double F, double B, double x) {
                                                            	double tmp;
                                                            	if (F <= -2.8e-75) {
                                                            		tmp = (-1.0 - x) / B;
                                                            	} else {
                                                            		tmp = -x / B;
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(F, B, x):
                                                            	tmp = 0
                                                            	if F <= -2.8e-75:
                                                            		tmp = (-1.0 - x) / B
                                                            	else:
                                                            		tmp = -x / B
                                                            	return tmp
                                                            
                                                            function code(F, B, x)
                                                            	tmp = 0.0
                                                            	if (F <= -2.8e-75)
                                                            		tmp = Float64(Float64(-1.0 - x) / B);
                                                            	else
                                                            		tmp = Float64(Float64(-x) / B);
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            function tmp_2 = code(F, B, x)
                                                            	tmp = 0.0;
                                                            	if (F <= -2.8e-75)
                                                            		tmp = (-1.0 - x) / B;
                                                            	else
                                                            		tmp = -x / B;
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[F_, B_, x_] := If[LessEqual[F, -2.8e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\
                                                            \;\;\;\;\frac{-1 - x}{B}\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\frac{-x}{B}\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 2 regimes
                                                            2. if F < -2.79999999999999998e-75

                                                              1. Initial program 72.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 rewrites32.4%

                                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                              6. Taylor expanded in F around -inf

                                                                \[\leadsto \frac{-1 - x}{B} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites36.8%

                                                                  \[\leadsto \frac{-1 - x}{B} \]

                                                                if -2.79999999999999998e-75 < F

                                                                1. Initial program 86.8%

                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                2. Add Preprocessing
                                                                3. Taylor expanded in B around 0

                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                4. Step-by-step derivation
                                                                  1. 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{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \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.6

                                                                    \[\leadsto \frac{-x}{B} \]
                                                                8. Applied rewrites29.6%

                                                                  \[\leadsto \frac{-x}{B} \]
                                                              8. Recombined 2 regimes into one program.
                                                              9. Final simplification31.7%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
                                                              10. Add Preprocessing

                                                              Alternative 29: 30.1% accurate, 21.7× 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 82.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 rewrites40.5%

                                                                \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \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.f6426.1

                                                                  \[\leadsto \frac{-x}{B} \]
                                                              8. Applied rewrites26.1%

                                                                \[\leadsto \frac{-x}{B} \]
                                                              9. Final simplification26.1%

                                                                \[\leadsto \frac{-x}{B} \]
                                                              10. Add Preprocessing

                                                              Reproduce

                                                              ?
                                                              herbie shell --seed 2025064 
                                                              (FPCore (F B x)
                                                                :name "VandenBroeck and Keller, Equation (23)"
                                                                :precision binary64
                                                                (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))