VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.2% → 99.7%
Time: 9.5s
Alternatives: 20
Speedup: 1.6×

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

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

Initial Program: 77.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.4× speedup?

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

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

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

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


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

    1. Initial program 32.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000004e154 < F < 5.0000000000000003e129

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e129 < F

    1. Initial program 42.9%

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

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

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

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

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

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

Alternative 2: 53.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\ t_2 := \frac{F}{\sin B}\\ t_3 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{+14}:\\ \;\;\;\;t\_0 + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\ \mathbf{elif}\;t\_3 \leq 5:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_2\\ \mathbf{elif}\;t\_3 \leq 10^{+110}:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_1, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_1, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B))))
        (t_1 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))))
        (t_2 (/ F (sin B)))
        (t_3 (+ t_0 (* t_2 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
   (if (<= t_3 -5e+14)
     (+ t_0 (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
     (if (<= t_3 5.0)
       (* (sqrt (/ 1.0 (fma F F 2.0))) t_2)
       (if (<= t_3 1e+110)
         (/
          (fma
           t_1
           F
           (-
            (*
             (fma (* 0.16666666666666666 F) t_1 (* 0.3333333333333333 x))
             (* B B))
            x))
          B)
         (- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x (tan B))))))))
double code(double F, double B, double x) {
	double t_0 = x * (-1.0 / tan(B));
	double t_1 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
	double t_2 = F / sin(B);
	double t_3 = t_0 + (t_2 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
	double tmp;
	if (t_3 <= -5e+14) {
		tmp = t_0 + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
	} else if (t_3 <= 5.0) {
		tmp = sqrt((1.0 / fma(F, F, 2.0))) * t_2;
	} else if (t_3 <= 1e+110) {
		tmp = fma(t_1, F, ((fma((0.16666666666666666 * F), t_1, (0.3333333333333333 * x)) * (B * B)) - x)) / B;
	} else {
		tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / tan(B));
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B)))
	t_1 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0)))
	t_2 = Float64(F / sin(B))
	t_3 = Float64(t_0 + Float64(t_2 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
	tmp = 0.0
	if (t_3 <= -5e+14)
		tmp = Float64(t_0 + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B));
	elseif (t_3 <= 5.0)
		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * t_2);
	elseif (t_3 <= 1e+110)
		tmp = Float64(fma(t_1, F, Float64(Float64(fma(Float64(0.16666666666666666 * F), t_1, Float64(0.3333333333333333 * x)) * Float64(B * B)) - x)) / B);
	else
		tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / tan(B)));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(t$95$2 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+14], N[(t$95$0 + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5.0], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 1e+110], N[(N[(t$95$1 * F + N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$1 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
t_2 := \frac{F}{\sin B}\\
t_3 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+14}:\\
\;\;\;\;t\_0 + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\

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

\mathbf{elif}\;t\_3 \leq 10^{+110}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_1, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_1, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -5e14

    1. Initial program 93.8%

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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)\right)}{B}} \]
    5. Applied rewrites62.0%

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

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

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

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

      1. Initial program 76.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 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 \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B}} \]
        2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      1. Initial program 96.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
      5. Applied rewrites46.4%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}} \]
      6. 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}} \]
      7. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

      1. Initial program 54.9%

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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)\right)}{B}} \]
      5. Applied rewrites70.6%

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

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

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

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

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

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

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

            \[\leadsto \frac{\mathsf{fma}\left(B \cdot B, \frac{1}{6}, 1\right)}{B} + \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\tan B}} \]
          6. fp-cancel-sub-signN/A

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \frac{1}{6}, 1\right)}{B} - x \cdot \frac{1}{\tan B}} \]
        3. Applied rewrites69.5%

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

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

      Alternative 3: 99.6% accurate, 1.4× speedup?

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

        1. Initial program 32.0%

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

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

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

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

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

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

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

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

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

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

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

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

        if -4.9999999999999999e144 < F < 1150

        1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1150 < F

        1. Initial program 58.9%

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

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

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

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

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

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

      Alternative 4: 99.1% accurate, 1.4× speedup?

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

        1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.5 < F < 1.75

        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.75 < F

          1. Initial program 58.9%

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

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

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

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

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

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

        Alternative 5: 91.5% accurate, 1.5× speedup?

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

          1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.0500000000000001e-30 < F < 14.5999999999999996

          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 14.5999999999999996 < F

          1. Initial program 58.9%

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

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

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

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

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

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

        Alternative 6: 91.5% accurate, 1.6× speedup?

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

          1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.0500000000000001e-30 < F < 14.5999999999999996

          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 14.5999999999999996 < F

          1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
          6. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \cos B, 1\right)}}{\sin B} \]
            5. *-commutativeN/A

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

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

              \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\cos B} \cdot x, 1\right)}{\sin B} \]
            8. lower-sin.f6499.7

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

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

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

        Alternative 7: 80.7% accurate, 1.6× speedup?

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

          1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.0500000000000001e-30 < F

          1. Initial program 83.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 \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
            2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 76.8% accurate, 2.1× speedup?

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

          1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.64999999999999998e-182 < x < 2.59999999999999981e-128

          1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \color{blue}{\frac{x}{B}} \]
          9. Step-by-step derivation
            1. lower-/.f6467.0

              \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \color{blue}{\frac{x}{B}} \]
          10. Applied rewrites67.0%

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

          if 2.59999999999999981e-128 < x

          1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 76.8% accurate, 2.2× speedup?

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

          1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.64999999999999998e-182 < x < 2.59999999999999981e-128

          1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \color{blue}{\frac{x}{B}} \]
          9. Step-by-step derivation
            1. lower-/.f6467.0

              \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \color{blue}{\frac{x}{B}} \]
          10. Applied rewrites67.0%

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

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

        Alternative 10: 72.2% accurate, 2.2× speedup?

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

          1. Initial program 86.6%

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

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

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

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

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

          if -560 < x < 5.2e9

          1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 11: 54.9% accurate, 2.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\ \mathbf{if}\;B \leq 440:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right), \mathsf{fma}\left(\mathsf{fma}\left(\left(-F\right) \cdot -0.019444444444444445, t\_0, x \cdot 0.022222222222222223\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right)\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\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 (fma 2.0 x 2.0))))))
           (if (<= B 440.0)
             (/
              (-
               (fma
                t_0
                (fma (* (* B B) F) 0.16666666666666666 F)
                (*
                 (fma
                  (fma (* (- F) -0.019444444444444445) t_0 (* x 0.022222222222222223))
                  (* B B)
                  (* 0.3333333333333333 x))
                 (* B B)))
               x)
              B)
             (+ (* x (/ -1.0 (tan B))) (* (/ F B) (/ 1.0 F))))))
        double code(double F, double B, double x) {
        	double t_0 = sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))));
        	double tmp;
        	if (B <= 440.0) {
        		tmp = (fma(t_0, fma(((B * B) * F), 0.16666666666666666, F), (fma(fma((-F * -0.019444444444444445), t_0, (x * 0.022222222222222223)), (B * B), (0.3333333333333333 * x)) * (B * B))) - x) / B;
        	} else {
        		tmp = (x * (-1.0 / tan(B))) + ((F / B) * (1.0 / F));
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	t_0 = sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0))))
        	tmp = 0.0
        	if (B <= 440.0)
        		tmp = Float64(Float64(fma(t_0, fma(Float64(Float64(B * B) * F), 0.16666666666666666, F), Float64(fma(fma(Float64(Float64(-F) * -0.019444444444444445), t_0, Float64(x * 0.022222222222222223)), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B))) - x) / B);
        	else
        		tmp = Float64(Float64(x * Float64(-1.0 / 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[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 440.0], N[(N[(N[(t$95$0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.16666666666666666 + F), $MachinePrecision] + N[(N[(N[(N[((-F) * -0.019444444444444445), $MachinePrecision] * t$95$0 + N[(x * 0.022222222222222223), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $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, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
        \mathbf{if}\;B \leq 440:\\
        \;\;\;\;\frac{\mathsf{fma}\left(t\_0, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right), \mathsf{fma}\left(\mathsf{fma}\left(\left(-F\right) \cdot -0.019444444444444445, t\_0, x \cdot 0.022222222222222223\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right)\right) - x}{B}\\
        
        \mathbf{else}:\\
        \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{1}{F}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if B < 440

          1. Initial program 74.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{\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) + \left(\frac{1}{3} \cdot x + {B}^{2} \cdot \left(-1 \cdot \left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \left(\frac{-1}{36} \cdot F + \frac{1}{120} \cdot F\right)\right) + \left(\frac{-1}{9} \cdot x + \frac{2}{15} \cdot x\right)\right)\right)\right)\right) - x}{B}} \]
          4. Applied rewrites55.4%

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

          if 440 < B

          1. Initial program 87.3%

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

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

            \[\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) + \color{blue}{\frac{F}{B}} \cdot \frac{1}{F} \]
          7. Step-by-step derivation
            1. lower-/.f6452.8

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

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

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

        Alternative 12: 49.3% accurate, 2.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.16:\\ \;\;\;\;\left(-x\right) \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right)}{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 0.16)
           (+
            (*
             (- x)
             (/
              (fma
               (- (* -0.022222222222222223 (* B B)) 0.3333333333333333)
               (* B B)
               1.0)
              B))
            (/
             (*
              (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
              (fma (* (* B B) F) 0.16666666666666666 F))
             B))
           (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))))
        double code(double F, double B, double x) {
        	double tmp;
        	if (B <= 0.16) {
        		tmp = (-x * (fma(((-0.022222222222222223 * (B * B)) - 0.3333333333333333), (B * B), 1.0) / B)) + ((sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(((B * B) * F), 0.16666666666666666, F)) / 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 <= 0.16)
        		tmp = Float64(Float64(Float64(-x) * Float64(fma(Float64(Float64(-0.022222222222222223 * Float64(B * B)) - 0.3333333333333333), Float64(B * B), 1.0) / B)) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * fma(Float64(Float64(B * B) * F), 0.16666666666666666, F)) / 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, 0.16], N[(N[((-x) * N[(N[(N[(N[(-0.022222222222222223 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.16666666666666666 + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $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 0.16:\\
        \;\;\;\;\left(-x\right) \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B} + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right)}{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 < 0.160000000000000003

          1. Initial program 74.6%

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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)\right)}{B}} \]
          5. Applied rewrites59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 0.160000000000000003 < B

          1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

        Alternative 13: 51.7% accurate, 2.5× speedup?

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

          1. Initial program 65.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
          5. Applied rewrites41.5%

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

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

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

            if -7.09999999999999981e-28 < F < 2.79999999999999999e35

            1. Initial program 99.4%

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

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

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

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

            if 2.79999999999999999e35 < F

            1. Initial program 56.2%

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

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

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{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)\right)}{B}} \]
            5. Applied rewrites42.0%

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

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

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

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

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

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(B \cdot B, \frac{1}{6}, 1\right)}{B} + \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\tan B}} \]
                6. fp-cancel-sub-signN/A

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(B \cdot B, \frac{1}{6}, 1\right)}{B} - x \cdot \frac{1}{\tan B}} \]
              3. Applied rewrites59.9%

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

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

            Alternative 14: 49.4% accurate, 5.7× speedup?

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

              1. Initial program 65.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
              5. Applied rewrites41.5%

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

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

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

                if -7.09999999999999981e-28 < F < 1150

                1. Initial program 99.4%

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

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

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

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

                if 1150 < F

                1. Initial program 58.9%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in 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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                5. Applied rewrites37.7%

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

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

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

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

                Alternative 15: 49.2% accurate, 6.0× speedup?

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

                  1. Initial program 65.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                  5. Applied rewrites41.5%

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

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

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

                    if -7.09999999999999981e-28 < F < 11.199999999999999

                    1. Initial program 99.4%

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

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

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

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

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

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

                      if 11.199999999999999 < F

                      1. Initial program 58.9%

                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in 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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                      5. Applied rewrites37.7%

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

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

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

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

                      Alternative 16: 49.0% accurate, 6.2× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.1 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 350000000000:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (if (<= F -7.1e-28)
                         (/ (- -1.0 x) B)
                         (if (<= F 350000000000.0)
                           (/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
                           (/ (- 1.0 x) B))))
                      double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -7.1e-28) {
                      		tmp = (-1.0 - x) / B;
                      	} else if (F <= 350000000000.0) {
                      		tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
                      	} else {
                      		tmp = (1.0 - x) / B;
                      	}
                      	return tmp;
                      }
                      
                      function code(F, B, x)
                      	tmp = 0.0
                      	if (F <= -7.1e-28)
                      		tmp = Float64(Float64(-1.0 - x) / B);
                      	elseif (F <= 350000000000.0)
                      		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / 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, -7.1e-28], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 350000000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;F \leq -7.1 \cdot 10^{-28}:\\
                      \;\;\;\;\frac{-1 - x}{B}\\
                      
                      \mathbf{elif}\;F \leq 350000000000:\\
                      \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\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 < -7.09999999999999981e-28

                        1. Initial program 65.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                        5. Applied rewrites41.5%

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

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

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

                          if -7.09999999999999981e-28 < F < 3.5e11

                          1. Initial program 99.4%

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

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

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

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

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

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

                            if 3.5e11 < F

                            1. Initial program 57.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                            5. Applied rewrites38.8%

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

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

                                \[\leadsto \frac{1 - x}{B} \]
                            8. Recombined 3 regimes into one program.
                            9. Final simplification48.4%

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

                            Alternative 17: 49.2% accurate, 6.8× speedup?

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

                              1. Initial program 65.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                              5. Applied rewrites41.5%

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

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

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

                                if -7.09999999999999981e-28 < F < 1.3500000000000001

                                1. Initial program 99.4%

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

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

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

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

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

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

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

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

                                      if 1.3500000000000001 < F

                                      1. Initial program 58.9%

                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in 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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                      5. Applied rewrites37.7%

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

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

                                          \[\leadsto \frac{1 - x}{B} \]
                                      8. Recombined 3 regimes into one program.
                                      9. Final simplification48.4%

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

                                      Alternative 18: 42.5% accurate, 13.6× speedup?

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

                                        1. Initial program 67.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                        5. Applied rewrites41.6%

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

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

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

                                          if -4.8000000000000003e-65 < F < 2.7000000000000001e-33

                                          1. Initial program 99.4%

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

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

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

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

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

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

                                            if 2.7000000000000001e-33 < F

                                            1. Initial program 63.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            5. Applied rewrites40.0%

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

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

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

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{-65}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-33}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                            10. Add Preprocessing

                                            Alternative 19: 35.0% accurate, 17.5× speedup?

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

                                              1. Initial program 67.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              5. Applied rewrites41.6%

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

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

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

                                                if -4.8000000000000003e-65 < F

                                                1. Initial program 83.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 \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                5. Applied rewrites41.2%

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

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

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

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{-65}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
                                                10. Add Preprocessing

                                                Alternative 20: 28.0% accurate, 26.3× speedup?

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

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

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

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

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

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

                                                    \[\leadsto \frac{-x}{B} \]
                                                  2. Final simplification27.3%

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

                                                  Reproduce

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