VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.6% → 99.1%
Time: 11.6s
Alternatives: 24
Speedup: 1.5×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 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.6% 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.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7e7 < F < 1.8999999999999999e-10

    1. Initial program 99.5%

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

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

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

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

    if 1.8999999999999999e-10 < F

    1. Initial program 56.6%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
      2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
      15. lower-sin.f6499.9

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

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

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

Alternative 2: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2e8 < F < 1.8999999999999999e-10

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8999999999999999e-10 < F

    1. Initial program 56.6%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
      2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
      15. lower-sin.f6499.9

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

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

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

Alternative 3: 55.9% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\ \mathbf{if}\;B \leq 0.8:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \mathsf{fma}\left(\mathsf{fma}\left(\left(--0.019444444444444445\right) \cdot F, t\_0, 0.022222222222222223 \cdot x\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} + {B}^{-1}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))))
   (if (<= B 0.8)
     (/
      (-
       (fma
        t_0
        (fma (* 0.16666666666666666 F) (* B B) F)
        (*
         (fma
          (fma (* (- -0.019444444444444445) F) t_0 (* 0.022222222222222223 x))
          (* B B)
          (* 0.3333333333333333 x))
         (* B B)))
       x)
      B)
     (+ (* x (/ -1.0 (tan B))) (pow B -1.0)))))
double code(double F, double B, double x) {
	double t_0 = sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0));
	double tmp;
	if (B <= 0.8) {
		tmp = (fma(t_0, fma((0.16666666666666666 * F), (B * B), F), (fma(fma((-(-0.019444444444444445) * F), t_0, (0.022222222222222223 * x)), (B * B), (0.3333333333333333 * x)) * (B * B))) - x) / B;
	} else {
		tmp = (x * (-1.0 / tan(B))) + pow(B, -1.0);
	}
	return tmp;
}
function code(F, B, x)
	t_0 = sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0))
	tmp = 0.0
	if (B <= 0.8)
		tmp = Float64(Float64(fma(t_0, fma(Float64(0.16666666666666666 * F), Float64(B * B), F), Float64(fma(fma(Float64(Float64(-(-0.019444444444444445)) * F), t_0, Float64(0.022222222222222223 * x)), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B))) - x) / B);
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (B ^ -1.0));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.8], N[(N[(N[(t$95$0 * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision] + N[(N[(N[(N[((--0.019444444444444445) * F), $MachinePrecision] * t$95$0 + N[(0.022222222222222223 * x), $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[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\
\mathbf{if}\;B \leq 0.8:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \mathsf{fma}\left(\mathsf{fma}\left(\left(--0.019444444444444445\right) \cdot F, t\_0, 0.022222222222222223 \cdot x\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} + {B}^{-1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 0.80000000000000004

    1. Initial program 70.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{\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 rewrites65.1%

      \[\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(0.16666666666666666 \cdot F, B \cdot B, F\right), \mathsf{fma}\left(\mathsf{fma}\left(--0.019444444444444445 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, 0.022222222222222223 \cdot x\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right)\right) - x}{B}} \]

    if 0.80000000000000004 < B

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.8:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \mathsf{fma}\left(\mathsf{fma}\left(\left(--0.019444444444444445\right) \cdot F, \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, 0.022222222222222223 \cdot x\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} + {B}^{-1}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 4: 91.8% accurate, 1.4× speedup?

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

      1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.75 < F < 1.8999999999999999e-10

      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}, \frac{-x}{\tan B}\right) \]
      8. 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) \]
      9. Step-by-step derivation
        1. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.8999999999999999e-10 < F

      1. Initial program 56.6%

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

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

          \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
        2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
        15. lower-sin.f6499.9

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

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

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

    Alternative 5: 85.4% accurate, 1.4× speedup?

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

      1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.75 < F < 1.46000000000000005e32

      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}, \frac{-x}{\tan B}\right) \]
      8. 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) \]
      9. Step-by-step derivation
        1. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.46000000000000005e32 < F

      1. Initial program 53.2%

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

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

          \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
        2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
        15. lower-sin.f6499.9

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

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

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

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

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

      Alternative 6: 78.0% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]
        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          10. lower-*.f6419.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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
        8. Applied rewrites19.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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
        9. Taylor expanded in F around -inf

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

            \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(\frac{-1}{45} \cdot \left(B \cdot B\right) - \frac{1}{3}, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
          2. lower-sin.f6468.5

            \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
        11. Applied rewrites68.5%

          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
        12. Taylor expanded in B around 0

          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
        13. Step-by-step derivation
          1. lower-/.f6481.9

            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
        14. Applied rewrites81.9%

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

        if -6.3e87 < F < 1.46000000000000005e32

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(F, \frac{\color{blue}{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B}, \frac{-x}{\tan B}\right) \]
        8. 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) \]
        9. Step-by-step derivation
          1. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.46000000000000005e32 < F

        1. Initial program 53.2%

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

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

            \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
          2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
          15. lower-sin.f6499.9

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

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

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

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

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

        Alternative 7: 78.2% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            10. lower-*.f6421.8

              \[\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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          8. Applied rewrites21.8%

            \[\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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
          9. Taylor expanded in F around -inf

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

              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(\frac{-1}{45} \cdot \left(B \cdot B\right) - \frac{1}{3}, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
            2. lower-sin.f6466.2

              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
          11. Applied rewrites66.2%

            \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
          12. Taylor expanded in B around 0

            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
          13. Step-by-step derivation
            1. lower-/.f6479.2

              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
          14. Applied rewrites79.2%

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

          if -2e18 < F < 1.46000000000000005e32

          1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.46000000000000005e32 < F

          1. Initial program 53.2%

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

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

              \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
            2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
            15. lower-sin.f6499.9

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

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

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

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

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

          Alternative 8: 77.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
              10. lower-*.f6425.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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            8. Applied rewrites25.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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
            9. Taylor expanded in F around -inf

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

                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(\frac{-1}{45} \cdot \left(B \cdot B\right) - \frac{1}{3}, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
              2. lower-sin.f6466.3

                \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
            11. Applied rewrites66.3%

              \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
            12. Taylor expanded in B around 0

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

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
            14. Applied rewrites78.4%

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

            if -1.75 < F < 6e21

            1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 6e21 < F

              1. Initial program 55.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}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
              4. Step-by-step derivation
                1. associate-/l*N/A

                  \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                15. lower-sin.f6499.9

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

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

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

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

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

              Alternative 9: 98.8% accurate, 1.5× speedup?

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

                1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.3999999999999999 < F < 1.8999999999999999e-10

                1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 1.8999999999999999e-10 < F

                  1. Initial program 56.6%

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

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

                      \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                    2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                    15. lower-sin.f6499.9

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

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

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

                Alternative 10: 69.7% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -5.8e-11 < x < -2.45e-83

                    1. Initial program 65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -2.45e-83 < x < 8.59999999999999947e-64

                      1. Initial program 73.3%

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

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

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

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

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

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

                    Alternative 11: 55.9% accurate, 1.6× speedup?

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

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

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

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

                      if 0.80000000000000004 < B

                      1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{B}} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification62.2%

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

                      Alternative 12: 57.8% accurate, 2.0× speedup?

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

                        1. Initial program 31.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                        5. Applied rewrites36.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 rewrites56.6%

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

                          if -6.2e133 < F < 1.8999999999999999e-10

                          1. Initial program 96.8%

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

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

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

                          if 1.8999999999999999e-10 < F

                          1. Initial program 56.6%

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

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

                              \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                            2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                            15. lower-sin.f6499.9

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

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

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

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

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

                          Alternative 13: 50.9% accurate, 2.0× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\\ \mathbf{if}\;F \leq -6.2 \cdot 10^{+133}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+61}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \left(0.3333333333333333 \cdot \left(B \cdot B\right)\right) \cdot x\right) - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(-0.041666666666666664 \cdot x - \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, t\_0\right), -0.16666666666666666, \mathsf{fma}\left(0.008333333333333333, -x, 0.008333333333333333\right)\right), B \cdot B, t\_0\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (let* ((t_0 (fma 0.16666666666666666 (- x) 0.16666666666666666)))
                             (if (<= F -6.2e+133)
                               (/ (- -1.0 x) B)
                               (if (<= F 2.2e+61)
                                 (/
                                  (-
                                   (fma
                                    (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))
                                    (fma (* 0.16666666666666666 F) (* B B) F)
                                    (* (* 0.3333333333333333 (* B B)) x))
                                   x)
                                  B)
                                 (/
                                  (+
                                   (fma
                                    (fma
                                     0.5
                                     x
                                     (fma
                                      (-
                                       (* -0.041666666666666664 x)
                                       (fma
                                        (fma 0.5 x t_0)
                                        -0.16666666666666666
                                        (fma 0.008333333333333333 (- x) 0.008333333333333333)))
                                      (* B B)
                                      t_0))
                                    (* B B)
                                    (- x))
                                   1.0)
                                  B)))))
                          double code(double F, double B, double x) {
                          	double t_0 = fma(0.16666666666666666, -x, 0.16666666666666666);
                          	double tmp;
                          	if (F <= -6.2e+133) {
                          		tmp = (-1.0 - x) / B;
                          	} else if (F <= 2.2e+61) {
                          		tmp = (fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), fma((0.16666666666666666 * F), (B * B), F), ((0.3333333333333333 * (B * B)) * x)) - x) / B;
                          	} else {
                          		tmp = (fma(fma(0.5, x, fma(((-0.041666666666666664 * x) - fma(fma(0.5, x, t_0), -0.16666666666666666, fma(0.008333333333333333, -x, 0.008333333333333333))), (B * B), t_0)), (B * B), -x) + 1.0) / B;
                          	}
                          	return tmp;
                          }
                          
                          function code(F, B, x)
                          	t_0 = fma(0.16666666666666666, Float64(-x), 0.16666666666666666)
                          	tmp = 0.0
                          	if (F <= -6.2e+133)
                          		tmp = Float64(Float64(-1.0 - x) / B);
                          	elseif (F <= 2.2e+61)
                          		tmp = Float64(Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), fma(Float64(0.16666666666666666 * F), Float64(B * B), F), Float64(Float64(0.3333333333333333 * Float64(B * B)) * x)) - x) / B);
                          	else
                          		tmp = Float64(Float64(fma(fma(0.5, x, fma(Float64(Float64(-0.041666666666666664 * x) - fma(fma(0.5, x, t_0), -0.16666666666666666, fma(0.008333333333333333, Float64(-x), 0.008333333333333333))), Float64(B * B), t_0)), Float64(B * B), Float64(-x)) + 1.0) / B);
                          	end
                          	return tmp
                          end
                          
                          code[F_, B_, x_] := Block[{t$95$0 = N[(0.16666666666666666 * (-x) + 0.16666666666666666), $MachinePrecision]}, If[LessEqual[F, -6.2e+133], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e+61], N[(N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(N[(N[(-0.041666666666666664 * x), $MachinePrecision] - N[(N[(0.5 * x + t$95$0), $MachinePrecision] * -0.16666666666666666 + N[(0.008333333333333333 * (-x) + 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\\
                          \mathbf{if}\;F \leq -6.2 \cdot 10^{+133}:\\
                          \;\;\;\;\frac{-1 - x}{B}\\
                          
                          \mathbf{elif}\;F \leq 2.2 \cdot 10^{+61}:\\
                          \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \left(0.3333333333333333 \cdot \left(B \cdot B\right)\right) \cdot x\right) - x}{B}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(-0.041666666666666664 \cdot x - \mathsf{fma}\left(\mathsf{fma}\left(0.5, x, t\_0\right), -0.16666666666666666, \mathsf{fma}\left(0.008333333333333333, -x, 0.008333333333333333\right)\right), B \cdot B, t\_0\right)\right), B \cdot B, -x\right) + 1}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if F < -6.2e133

                            1. Initial program 31.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                            5. Applied rewrites36.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 rewrites56.6%

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

                              if -6.2e133 < F < 2.2e61

                              1. Initial program 97.0%

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

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

                                  \[\leadsto \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}} \]
                              5. Applied rewrites56.6%

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

                              if 2.2e61 < F

                              1. Initial program 49.1%

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

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

                                  \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              Alternative 14: 50.6% accurate, 2.0× speedup?

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

                                1. Initial program 31.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                5. Applied rewrites36.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 rewrites56.6%

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

                                  if -6.2e133 < F < 1.8999999999999999e-10

                                  1. Initial program 96.8%

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

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

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

                                  if 1.8999999999999999e-10 < F

                                  1. Initial program 56.6%

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

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

                                      \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                    2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                    15. lower-sin.f6499.9

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

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

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

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

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

                                  Alternative 15: 43.4% accurate, 2.3× speedup?

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

                                    1. Initial program 59.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}} \]
                                      2. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if -1.14999999999999996e-45 < F < -2.2e-167

                                      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}} \]
                                        2. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                      5. Applied rewrites76.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 x around 0

                                        \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites58.6%

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

                                        if -2.2e-167 < F < 1.22e-80

                                        1. Initial program 99.6%

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

                                          \[\leadsto \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}} \]
                                          2. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                          if 1.22e-80 < F < 1e-13

                                          1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if 1e-13 < F

                                            1. Initial program 57.7%

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

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

                                                \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                              2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                              15. lower-sin.f6498.8

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

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

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

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

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

                                            Alternative 16: 43.4% accurate, 2.3× speedup?

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

                                              1. Initial program 59.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}} \]
                                                2. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if -1.14999999999999996e-45 < F < -2.2e-167 or 1.22e-80 < F < 1e-13

                                                1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                5. Applied rewrites67.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 x around 0

                                                  \[\leadsto \frac{F}{B} \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites53.8%

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

                                                  if -2.2e-167 < F < 1.22e-80

                                                  1. Initial program 99.6%

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

                                                    \[\leadsto \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}} \]
                                                    2. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                    if 1e-13 < F

                                                    1. Initial program 57.7%

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

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

                                                        \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                                      2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                                      15. lower-sin.f6498.8

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

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

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

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

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

                                                    Alternative 17: 64.7% accurate, 2.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}} \]
                                                      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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                      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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                        10. lower-*.f6425.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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                      8. Applied rewrites25.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{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \]
                                                      9. Taylor expanded in F around -inf

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

                                                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(\frac{-1}{45} \cdot \left(B \cdot B\right) - \frac{1}{3}, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                                        2. lower-sin.f6466.3

                                                          \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                                                      11. Applied rewrites66.3%

                                                        \[\leadsto \left(-x \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                                      12. Taylor expanded in B around 0

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

                                                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
                                                      14. Applied rewrites78.4%

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

                                                      if -1.75 < F < 6e21

                                                      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      if 6e21 < F

                                                      1. Initial program 55.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}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                                      4. Step-by-step derivation
                                                        1. associate-/l*N/A

                                                          \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                                        2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \frac{1 + \color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
                                                        14. lower-cos.f64N/A

                                                          \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                                        15. lower-sin.f6499.9

                                                          \[\leadsto \frac{1 + \left(-x\right) \cdot \cos B}{\color{blue}{\sin B}} \]
                                                      5. Applied rewrites99.9%

                                                        \[\leadsto \color{blue}{\frac{1 + \left(-x\right) \cdot \cos B}{\sin B}} \]
                                                      6. Taylor expanded in B around 0

                                                        \[\leadsto \frac{1 + -1 \cdot x}{\sin \color{blue}{B}} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites86.7%

                                                          \[\leadsto \frac{\mathsf{fma}\left(-1, x, 1\right)}{\sin \color{blue}{B}} \]
                                                      8. Recombined 3 regimes into one program.
                                                      9. Final simplification71.5%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.75:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{+21}:\\ \;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, x, 1\right)}{\sin B}\\ \end{array} \]
                                                      10. Add Preprocessing

                                                      Alternative 18: 51.1% accurate, 2.4× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{+53}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{+21}:\\ \;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \end{array} \]
                                                      (FPCore (F B x)
                                                       :precision binary64
                                                       (if (<= F -2e+53)
                                                         (/ (- -1.0 x) B)
                                                         (if (<= F 9.2e+21)
                                                           (/ (- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F) x) B)
                                                           (/
                                                            (+
                                                             (fma
                                                              (fma 0.5 x (fma 0.16666666666666666 (- x) 0.16666666666666666))
                                                              (* B B)
                                                              (- x))
                                                             1.0)
                                                            B))))
                                                      double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= -2e+53) {
                                                      		tmp = (-1.0 - x) / B;
                                                      	} else if (F <= 9.2e+21) {
                                                      		tmp = ((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * F) - x) / B;
                                                      	} else {
                                                      		tmp = (fma(fma(0.5, x, fma(0.16666666666666666, -x, 0.16666666666666666)), (B * B), -x) + 1.0) / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      function code(F, B, x)
                                                      	tmp = 0.0
                                                      	if (F <= -2e+53)
                                                      		tmp = Float64(Float64(-1.0 - x) / B);
                                                      	elseif (F <= 9.2e+21)
                                                      		tmp = Float64(Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * F) - x) / B);
                                                      	else
                                                      		tmp = Float64(Float64(fma(fma(0.5, x, fma(0.16666666666666666, Float64(-x), 0.16666666666666666)), Float64(B * B), Float64(-x)) + 1.0) / B);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      code[F_, B_, x_] := If[LessEqual[F, -2e+53], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.2e+21], N[(N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * (-x) + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      \mathbf{if}\;F \leq -2 \cdot 10^{+53}:\\
                                                      \;\;\;\;\frac{-1 - x}{B}\\
                                                      
                                                      \mathbf{elif}\;F \leq 9.2 \cdot 10^{+21}:\\
                                                      \;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot F - x}{B}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 3 regimes
                                                      2. if F < -2e53

                                                        1. Initial program 47.6%

                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in 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}} \]
                                                          2. lower--.f64N/A

                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                          3. *-commutativeN/A

                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                          4. lower-*.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                          5. lower-sqrt.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                          6. lower-/.f64N/A

                                                            \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                          7. associate-+r+N/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                          8. +-commutativeN/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                          9. unpow2N/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                          10. lower-fma.f64N/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                          11. +-commutativeN/A

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                          12. lower-fma.f6446.5

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                        5. Applied rewrites46.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 rewrites60.7%

                                                            \[\leadsto \frac{-1 - x}{B} \]

                                                          if -2e53 < F < 9.2e21

                                                          1. Initial program 98.1%

                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                          2. Add Preprocessing
                                                          3. 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}} \]
                                                            2. lower--.f64N/A

                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                            3. *-commutativeN/A

                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                            4. lower-*.f64N/A

                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                            5. lower-sqrt.f64N/A

                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                            6. lower-/.f64N/A

                                                              \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                            7. associate-+r+N/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                            8. +-commutativeN/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                            9. unpow2N/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                            10. lower-fma.f64N/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                            11. +-commutativeN/A

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                            12. lower-fma.f6455.2

                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                          5. Applied rewrites55.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}} \]

                                                          if 9.2e21 < F

                                                          1. Initial program 55.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}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                                          4. Step-by-step derivation
                                                            1. associate-/l*N/A

                                                              \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                                            2. fp-cancel-sub-sign-invN/A

                                                              \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                                            3. distribute-lft-neg-inN/A

                                                              \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
                                                            4. associate-/l*N/A

                                                              \[\leadsto \frac{1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right)\right) \]
                                                            5. mul-1-negN/A

                                                              \[\leadsto \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                            6. associate-*r/N/A

                                                              \[\leadsto \frac{1}{\sin B} + \color{blue}{\frac{-1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                            7. div-add-revN/A

                                                              \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                            8. lower-/.f64N/A

                                                              \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                            9. lower-+.f64N/A

                                                              \[\leadsto \frac{\color{blue}{1 + -1 \cdot \left(x \cdot \cos B\right)}}{\sin B} \]
                                                            10. associate-*r*N/A

                                                              \[\leadsto \frac{1 + \color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
                                                            11. mul-1-negN/A

                                                              \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \cos B}{\sin B} \]
                                                            12. lower-*.f64N/A

                                                              \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \cos B}}{\sin B} \]
                                                            13. lower-neg.f64N/A

                                                              \[\leadsto \frac{1 + \color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
                                                            14. lower-cos.f64N/A

                                                              \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                                            15. lower-sin.f6499.9

                                                              \[\leadsto \frac{1 + \left(-x\right) \cdot \cos B}{\color{blue}{\sin B}} \]
                                                          5. Applied rewrites99.9%

                                                            \[\leadsto \color{blue}{\frac{1 + \left(-x\right) \cdot \cos B}{\sin B}} \]
                                                          6. Taylor expanded in B around 0

                                                            \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + -1 \cdot x\right)\right)\right)}{\color{blue}{B}} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites55.8%

                                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{\color{blue}{B}} \]
                                                          8. Recombined 3 regimes into one program.
                                                          9. Final simplification56.7%

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{+53}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{+21}:\\ \;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \]
                                                          10. Add Preprocessing

                                                          Alternative 19: 50.6% accurate, 2.5× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-10}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \end{array} \]
                                                          (FPCore (F B x)
                                                           :precision binary64
                                                           (if (<= F -1.4)
                                                             (/ (- -1.0 x) B)
                                                             (if (<= F 1.9e-10)
                                                               (/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
                                                               (/
                                                                (+
                                                                 (fma
                                                                  (fma 0.5 x (fma 0.16666666666666666 (- x) 0.16666666666666666))
                                                                  (* B B)
                                                                  (- x))
                                                                 1.0)
                                                                B))))
                                                          double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= -1.4) {
                                                          		tmp = (-1.0 - x) / B;
                                                          	} else if (F <= 1.9e-10) {
                                                          		tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
                                                          	} else {
                                                          		tmp = (fma(fma(0.5, x, fma(0.16666666666666666, -x, 0.16666666666666666)), (B * B), -x) + 1.0) / B;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(F, B, x)
                                                          	tmp = 0.0
                                                          	if (F <= -1.4)
                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                          	elseif (F <= 1.9e-10)
                                                          		tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B);
                                                          	else
                                                          		tmp = Float64(Float64(fma(fma(0.5, x, fma(0.16666666666666666, Float64(-x), 0.16666666666666666)), Float64(B * B), Float64(-x)) + 1.0) / B);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-10], N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * (-x) + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;F \leq -1.4:\\
                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                          
                                                          \mathbf{elif}\;F \leq 1.9 \cdot 10^{-10}:\\
                                                          \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 3 regimes
                                                          2. if F < -1.3999999999999999

                                                            1. Initial program 55.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}} \]
                                                              2. lower--.f64N/A

                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                              3. *-commutativeN/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                              4. lower-*.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                              5. lower-sqrt.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                              6. lower-/.f64N/A

                                                                \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                              7. associate-+r+N/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                              8. +-commutativeN/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                              9. unpow2N/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                              10. lower-fma.f64N/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                              11. +-commutativeN/A

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                              12. lower-fma.f6447.6

                                                                \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                            5. Applied rewrites47.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 rewrites59.0%

                                                                \[\leadsto \frac{-1 - x}{B} \]

                                                              if -1.3999999999999999 < F < 1.8999999999999999e-10

                                                              1. Initial program 99.5%

                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in B around 0

                                                                \[\leadsto \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}} \]
                                                                2. lower--.f64N/A

                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                3. *-commutativeN/A

                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                4. lower-*.f64N/A

                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                5. lower-sqrt.f64N/A

                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                6. lower-/.f64N/A

                                                                  \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                7. associate-+r+N/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                8. +-commutativeN/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                9. unpow2N/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                10. lower-fma.f64N/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                11. +-commutativeN/A

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                12. lower-fma.f6455.3

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                              5. Applied rewrites55.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 -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites55.3%

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, F, -x\right)}{\color{blue}{B}} \]

                                                                if 1.8999999999999999e-10 < F

                                                                1. Initial program 56.6%

                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                2. Add Preprocessing
                                                                3. Taylor expanded in F around inf

                                                                  \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                                                4. Step-by-step derivation
                                                                  1. associate-/l*N/A

                                                                    \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                                                  2. fp-cancel-sub-sign-invN/A

                                                                    \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                  3. distribute-lft-neg-inN/A

                                                                    \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
                                                                  4. associate-/l*N/A

                                                                    \[\leadsto \frac{1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right)\right) \]
                                                                  5. mul-1-negN/A

                                                                    \[\leadsto \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                  6. associate-*r/N/A

                                                                    \[\leadsto \frac{1}{\sin B} + \color{blue}{\frac{-1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                  7. div-add-revN/A

                                                                    \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                  8. lower-/.f64N/A

                                                                    \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                  9. lower-+.f64N/A

                                                                    \[\leadsto \frac{\color{blue}{1 + -1 \cdot \left(x \cdot \cos B\right)}}{\sin B} \]
                                                                  10. associate-*r*N/A

                                                                    \[\leadsto \frac{1 + \color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
                                                                  11. mul-1-negN/A

                                                                    \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \cos B}{\sin B} \]
                                                                  12. lower-*.f64N/A

                                                                    \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \cos B}}{\sin B} \]
                                                                  13. lower-neg.f64N/A

                                                                    \[\leadsto \frac{1 + \color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
                                                                  14. lower-cos.f64N/A

                                                                    \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                                                  15. lower-sin.f6499.9

                                                                    \[\leadsto \frac{1 + \left(-x\right) \cdot \cos B}{\color{blue}{\sin B}} \]
                                                                5. Applied rewrites99.9%

                                                                  \[\leadsto \color{blue}{\frac{1 + \left(-x\right) \cdot \cos B}{\sin B}} \]
                                                                6. Taylor expanded in B around 0

                                                                  \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + -1 \cdot x\right)\right)\right)}{\color{blue}{B}} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites56.2%

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{\color{blue}{B}} \]
                                                                8. Recombined 3 regimes into one program.
                                                                9. Final simplification56.6%

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-10}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \]
                                                                10. Add Preprocessing

                                                                Alternative 20: 50.3% accurate, 6.1× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{+184}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{+21}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \end{array} \]
                                                                (FPCore (F B x)
                                                                 :precision binary64
                                                                 (if (<= F -5.2e+184)
                                                                   (/ (- -1.0 x) B)
                                                                   (if (<= F 9.2e+21)
                                                                     (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
                                                                     (/
                                                                      (+
                                                                       (fma
                                                                        (fma 0.5 x (fma 0.16666666666666666 (- x) 0.16666666666666666))
                                                                        (* B B)
                                                                        (- x))
                                                                       1.0)
                                                                      B))))
                                                                double code(double F, double B, double x) {
                                                                	double tmp;
                                                                	if (F <= -5.2e+184) {
                                                                		tmp = (-1.0 - x) / B;
                                                                	} else if (F <= 9.2e+21) {
                                                                		tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
                                                                	} else {
                                                                		tmp = (fma(fma(0.5, x, fma(0.16666666666666666, -x, 0.16666666666666666)), (B * B), -x) + 1.0) / B;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                function code(F, B, x)
                                                                	tmp = 0.0
                                                                	if (F <= -5.2e+184)
                                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                                	elseif (F <= 9.2e+21)
                                                                		tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B);
                                                                	else
                                                                		tmp = Float64(Float64(fma(fma(0.5, x, fma(0.16666666666666666, Float64(-x), 0.16666666666666666)), Float64(B * B), Float64(-x)) + 1.0) / B);
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                code[F_, B_, x_] := If[LessEqual[F, -5.2e+184], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.2e+21], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * (-x) + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;F \leq -5.2 \cdot 10^{+184}:\\
                                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                                
                                                                \mathbf{elif}\;F \leq 9.2 \cdot 10^{+21}:\\
                                                                \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 3 regimes
                                                                2. if F < -5.19999999999999986e184

                                                                  1. Initial program 30.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}} \]
                                                                    2. lower--.f64N/A

                                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                    3. *-commutativeN/A

                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                    4. lower-*.f64N/A

                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                    5. lower-sqrt.f64N/A

                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                    6. lower-/.f64N/A

                                                                      \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                    7. associate-+r+N/A

                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                    8. +-commutativeN/A

                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                    9. unpow2N/A

                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                    10. lower-fma.f64N/A

                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                    11. +-commutativeN/A

                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                    12. lower-fma.f6426.1

                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                  5. Applied rewrites26.1%

                                                                    \[\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 rewrites52.2%

                                                                      \[\leadsto \frac{-1 - x}{B} \]

                                                                    if -5.19999999999999986e184 < F < 9.2e21

                                                                    1. Initial program 92.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}} \]
                                                                      2. lower--.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                      3. *-commutativeN/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                      5. lower-sqrt.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                      6. lower-/.f64N/A

                                                                        \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                      7. associate-+r+N/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                      8. +-commutativeN/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                      9. unpow2N/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                      10. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                      11. +-commutativeN/A

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                      12. lower-fma.f6458.1

                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                    5. Applied rewrites58.1%

                                                                      \[\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 rewrites58.1%

                                                                        \[\leadsto \frac{\frac{F \cdot 1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B} \]

                                                                      if 9.2e21 < F

                                                                      1. Initial program 55.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}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                                                      4. Step-by-step derivation
                                                                        1. associate-/l*N/A

                                                                          \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                                                        2. fp-cancel-sub-sign-invN/A

                                                                          \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                        3. distribute-lft-neg-inN/A

                                                                          \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
                                                                        4. associate-/l*N/A

                                                                          \[\leadsto \frac{1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right)\right) \]
                                                                        5. mul-1-negN/A

                                                                          \[\leadsto \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                        6. associate-*r/N/A

                                                                          \[\leadsto \frac{1}{\sin B} + \color{blue}{\frac{-1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                        7. div-add-revN/A

                                                                          \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                        8. lower-/.f64N/A

                                                                          \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                        9. lower-+.f64N/A

                                                                          \[\leadsto \frac{\color{blue}{1 + -1 \cdot \left(x \cdot \cos B\right)}}{\sin B} \]
                                                                        10. associate-*r*N/A

                                                                          \[\leadsto \frac{1 + \color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
                                                                        11. mul-1-negN/A

                                                                          \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \cos B}{\sin B} \]
                                                                        12. lower-*.f64N/A

                                                                          \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \cos B}}{\sin B} \]
                                                                        13. lower-neg.f64N/A

                                                                          \[\leadsto \frac{1 + \color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
                                                                        14. lower-cos.f64N/A

                                                                          \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                                                        15. lower-sin.f6499.9

                                                                          \[\leadsto \frac{1 + \left(-x\right) \cdot \cos B}{\color{blue}{\sin B}} \]
                                                                      5. Applied rewrites99.9%

                                                                        \[\leadsto \color{blue}{\frac{1 + \left(-x\right) \cdot \cos B}{\sin B}} \]
                                                                      6. Taylor expanded in B around 0

                                                                        \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + -1 \cdot x\right)\right)\right)}{\color{blue}{B}} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites55.8%

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{\color{blue}{B}} \]
                                                                      8. Recombined 3 regimes into one program.
                                                                      9. Final simplification56.7%

                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{+184}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{+21}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \]
                                                                      10. Add Preprocessing

                                                                      Alternative 21: 42.5% accurate, 6.8× speedup?

                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.4 \cdot 10^{-167}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-65}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\ \end{array} \end{array} \]
                                                                      (FPCore (F B x)
                                                                       :precision binary64
                                                                       (if (<= F -3.4e-167)
                                                                         (/ (- -1.0 x) B)
                                                                         (if (<= F 4.2e-65)
                                                                           (/ (- x) B)
                                                                           (/
                                                                            (+
                                                                             (fma
                                                                              (fma 0.5 x (fma 0.16666666666666666 (- x) 0.16666666666666666))
                                                                              (* B B)
                                                                              (- x))
                                                                             1.0)
                                                                            B))))
                                                                      double code(double F, double B, double x) {
                                                                      	double tmp;
                                                                      	if (F <= -3.4e-167) {
                                                                      		tmp = (-1.0 - x) / B;
                                                                      	} else if (F <= 4.2e-65) {
                                                                      		tmp = -x / B;
                                                                      	} else {
                                                                      		tmp = (fma(fma(0.5, x, fma(0.16666666666666666, -x, 0.16666666666666666)), (B * B), -x) + 1.0) / B;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      function code(F, B, x)
                                                                      	tmp = 0.0
                                                                      	if (F <= -3.4e-167)
                                                                      		tmp = Float64(Float64(-1.0 - x) / B);
                                                                      	elseif (F <= 4.2e-65)
                                                                      		tmp = Float64(Float64(-x) / B);
                                                                      	else
                                                                      		tmp = Float64(Float64(fma(fma(0.5, x, fma(0.16666666666666666, Float64(-x), 0.16666666666666666)), Float64(B * B), Float64(-x)) + 1.0) / B);
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      code[F_, B_, x_] := If[LessEqual[F, -3.4e-167], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e-65], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * (-x) + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \begin{array}{l}
                                                                      \mathbf{if}\;F \leq -3.4 \cdot 10^{-167}:\\
                                                                      \;\;\;\;\frac{-1 - x}{B}\\
                                                                      
                                                                      \mathbf{elif}\;F \leq 4.2 \cdot 10^{-65}:\\
                                                                      \;\;\;\;\frac{-x}{B}\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{B}\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 3 regimes
                                                                      2. if F < -3.3999999999999997e-167

                                                                        1. Initial program 66.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}} \]
                                                                          2. lower--.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                          3. *-commutativeN/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                          4. lower-*.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                          5. lower-sqrt.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                          6. lower-/.f64N/A

                                                                            \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                          7. associate-+r+N/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                          8. +-commutativeN/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                          9. unpow2N/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                          10. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                          11. +-commutativeN/A

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                          12. lower-fma.f6452.3

                                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                        5. Applied rewrites52.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 -inf

                                                                          \[\leadsto \frac{-1 - x}{B} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites50.1%

                                                                            \[\leadsto \frac{-1 - x}{B} \]

                                                                          if -3.3999999999999997e-167 < F < 4.20000000000000006e-65

                                                                          1. Initial program 99.6%

                                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in B around 0

                                                                            \[\leadsto \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}} \]
                                                                            2. lower--.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                            3. *-commutativeN/A

                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                            4. lower-*.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                            5. lower-sqrt.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                            6. lower-/.f64N/A

                                                                              \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                            7. associate-+r+N/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                            8. +-commutativeN/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                            9. unpow2N/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                            10. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                            11. +-commutativeN/A

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                            12. lower-fma.f6450.5

                                                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                          5. Applied rewrites50.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{-1 \cdot x}{B} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites43.8%

                                                                              \[\leadsto \frac{-x}{B} \]

                                                                            if 4.20000000000000006e-65 < F

                                                                            1. Initial program 62.2%

                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in F around inf

                                                                              \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                                                            4. Step-by-step derivation
                                                                              1. associate-/l*N/A

                                                                                \[\leadsto \frac{1}{\sin B} - \color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
                                                                              2. fp-cancel-sub-sign-invN/A

                                                                                \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(\mathsf{neg}\left(x\right)\right) \cdot \frac{\cos B}{\sin B}} \]
                                                                              3. distribute-lft-neg-inN/A

                                                                                \[\leadsto \frac{1}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right)\right)} \]
                                                                              4. associate-/l*N/A

                                                                                \[\leadsto \frac{1}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right)\right) \]
                                                                              5. mul-1-negN/A

                                                                                \[\leadsto \frac{1}{\sin B} + \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                              6. associate-*r/N/A

                                                                                \[\leadsto \frac{1}{\sin B} + \color{blue}{\frac{-1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                              7. div-add-revN/A

                                                                                \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                              8. lower-/.f64N/A

                                                                                \[\leadsto \color{blue}{\frac{1 + -1 \cdot \left(x \cdot \cos B\right)}{\sin B}} \]
                                                                              9. lower-+.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{1 + -1 \cdot \left(x \cdot \cos B\right)}}{\sin B} \]
                                                                              10. associate-*r*N/A

                                                                                \[\leadsto \frac{1 + \color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
                                                                              11. mul-1-negN/A

                                                                                \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \cos B}{\sin B} \]
                                                                              12. lower-*.f64N/A

                                                                                \[\leadsto \frac{1 + \color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot \cos B}}{\sin B} \]
                                                                              13. lower-neg.f64N/A

                                                                                \[\leadsto \frac{1 + \color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
                                                                              14. lower-cos.f64N/A

                                                                                \[\leadsto \frac{1 + \left(-x\right) \cdot \color{blue}{\cos B}}{\sin B} \]
                                                                              15. lower-sin.f6492.8

                                                                                \[\leadsto \frac{1 + \left(-x\right) \cdot \cos B}{\color{blue}{\sin B}} \]
                                                                            5. Applied rewrites92.8%

                                                                              \[\leadsto \color{blue}{\frac{1 + \left(-x\right) \cdot \cos B}{\sin B}} \]
                                                                            6. Taylor expanded in B around 0

                                                                              \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + -1 \cdot x\right)\right)\right)}{\color{blue}{B}} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites50.6%

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, \mathsf{fma}\left(0.16666666666666666, -x, 0.16666666666666666\right)\right), B \cdot B, -x\right) + 1}{\color{blue}{B}} \]
                                                                            8. Recombined 3 regimes into one program.
                                                                            9. Add Preprocessing

                                                                            Alternative 22: 42.5% accurate, 13.6× speedup?

                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.4 \cdot 10^{-167}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-65}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                            (FPCore (F B x)
                                                                             :precision binary64
                                                                             (if (<= F -3.4e-167)
                                                                               (/ (- -1.0 x) B)
                                                                               (if (<= F 4.2e-65) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                            double code(double F, double B, double x) {
                                                                            	double tmp;
                                                                            	if (F <= -3.4e-167) {
                                                                            		tmp = (-1.0 - x) / B;
                                                                            	} else if (F <= 4.2e-65) {
                                                                            		tmp = -x / B;
                                                                            	} else {
                                                                            		tmp = (1.0 - x) / B;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            module fmin_fmax_functions
                                                                                implicit none
                                                                                private
                                                                                public fmax
                                                                                public fmin
                                                                            
                                                                                interface fmax
                                                                                    module procedure fmax88
                                                                                    module procedure fmax44
                                                                                    module procedure fmax84
                                                                                    module procedure fmax48
                                                                                end interface
                                                                                interface fmin
                                                                                    module procedure fmin88
                                                                                    module procedure fmin44
                                                                                    module procedure fmin84
                                                                                    module procedure fmin48
                                                                                end interface
                                                                            contains
                                                                                real(8) function fmax88(x, y) result (res)
                                                                                    real(8), intent (in) :: x
                                                                                    real(8), intent (in) :: y
                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                end function
                                                                                real(4) function fmax44(x, y) result (res)
                                                                                    real(4), intent (in) :: x
                                                                                    real(4), intent (in) :: y
                                                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                end function
                                                                                real(8) function fmax84(x, y) result(res)
                                                                                    real(8), intent (in) :: x
                                                                                    real(4), intent (in) :: y
                                                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                end function
                                                                                real(8) function fmax48(x, y) result(res)
                                                                                    real(4), intent (in) :: x
                                                                                    real(8), intent (in) :: y
                                                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                end function
                                                                                real(8) function fmin88(x, y) result (res)
                                                                                    real(8), intent (in) :: x
                                                                                    real(8), intent (in) :: y
                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                end function
                                                                                real(4) function fmin44(x, y) result (res)
                                                                                    real(4), intent (in) :: x
                                                                                    real(4), intent (in) :: y
                                                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                end function
                                                                                real(8) function fmin84(x, y) result(res)
                                                                                    real(8), intent (in) :: x
                                                                                    real(4), intent (in) :: y
                                                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                end function
                                                                                real(8) function fmin48(x, y) result(res)
                                                                                    real(4), intent (in) :: x
                                                                                    real(8), intent (in) :: y
                                                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                end function
                                                                            end module
                                                                            
                                                                            real(8) function code(f, b, x)
                                                                            use fmin_fmax_functions
                                                                                real(8), intent (in) :: f
                                                                                real(8), intent (in) :: b
                                                                                real(8), intent (in) :: x
                                                                                real(8) :: tmp
                                                                                if (f <= (-3.4d-167)) then
                                                                                    tmp = ((-1.0d0) - x) / b
                                                                                else if (f <= 4.2d-65) then
                                                                                    tmp = -x / b
                                                                                else
                                                                                    tmp = (1.0d0 - x) / b
                                                                                end if
                                                                                code = tmp
                                                                            end function
                                                                            
                                                                            public static double code(double F, double B, double x) {
                                                                            	double tmp;
                                                                            	if (F <= -3.4e-167) {
                                                                            		tmp = (-1.0 - x) / B;
                                                                            	} else if (F <= 4.2e-65) {
                                                                            		tmp = -x / B;
                                                                            	} else {
                                                                            		tmp = (1.0 - x) / B;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            def code(F, B, x):
                                                                            	tmp = 0
                                                                            	if F <= -3.4e-167:
                                                                            		tmp = (-1.0 - x) / B
                                                                            	elif F <= 4.2e-65:
                                                                            		tmp = -x / B
                                                                            	else:
                                                                            		tmp = (1.0 - x) / B
                                                                            	return tmp
                                                                            
                                                                            function code(F, B, x)
                                                                            	tmp = 0.0
                                                                            	if (F <= -3.4e-167)
                                                                            		tmp = Float64(Float64(-1.0 - x) / B);
                                                                            	elseif (F <= 4.2e-65)
                                                                            		tmp = Float64(Float64(-x) / B);
                                                                            	else
                                                                            		tmp = Float64(Float64(1.0 - x) / B);
                                                                            	end
                                                                            	return tmp
                                                                            end
                                                                            
                                                                            function tmp_2 = code(F, B, x)
                                                                            	tmp = 0.0;
                                                                            	if (F <= -3.4e-167)
                                                                            		tmp = (-1.0 - x) / B;
                                                                            	elseif (F <= 4.2e-65)
                                                                            		tmp = -x / B;
                                                                            	else
                                                                            		tmp = (1.0 - x) / B;
                                                                            	end
                                                                            	tmp_2 = tmp;
                                                                            end
                                                                            
                                                                            code[F_, B_, x_] := If[LessEqual[F, -3.4e-167], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e-65], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                            
                                                                            \begin{array}{l}
                                                                            
                                                                            \\
                                                                            \begin{array}{l}
                                                                            \mathbf{if}\;F \leq -3.4 \cdot 10^{-167}:\\
                                                                            \;\;\;\;\frac{-1 - x}{B}\\
                                                                            
                                                                            \mathbf{elif}\;F \leq 4.2 \cdot 10^{-65}:\\
                                                                            \;\;\;\;\frac{-x}{B}\\
                                                                            
                                                                            \mathbf{else}:\\
                                                                            \;\;\;\;\frac{1 - x}{B}\\
                                                                            
                                                                            
                                                                            \end{array}
                                                                            \end{array}
                                                                            
                                                                            Derivation
                                                                            1. Split input into 3 regimes
                                                                            2. if F < -3.3999999999999997e-167

                                                                              1. Initial program 66.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}} \]
                                                                                2. lower--.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                3. *-commutativeN/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                4. lower-*.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                5. lower-sqrt.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                6. lower-/.f64N/A

                                                                                  \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                7. associate-+r+N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                8. +-commutativeN/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                9. unpow2N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                10. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                12. lower-fma.f6452.3

                                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                              5. Applied rewrites52.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 -inf

                                                                                \[\leadsto \frac{-1 - x}{B} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites50.1%

                                                                                  \[\leadsto \frac{-1 - x}{B} \]

                                                                                if -3.3999999999999997e-167 < F < 4.20000000000000006e-65

                                                                                1. Initial program 99.6%

                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                2. Add Preprocessing
                                                                                3. Taylor expanded in B around 0

                                                                                  \[\leadsto \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}} \]
                                                                                  2. lower--.f64N/A

                                                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                  3. *-commutativeN/A

                                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                  4. lower-*.f64N/A

                                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                  5. lower-sqrt.f64N/A

                                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                  6. lower-/.f64N/A

                                                                                    \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                  7. associate-+r+N/A

                                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                  8. +-commutativeN/A

                                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                  9. unpow2N/A

                                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                  10. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                  11. +-commutativeN/A

                                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                  12. lower-fma.f6450.5

                                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                                5. Applied rewrites50.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{-1 \cdot x}{B} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites43.8%

                                                                                    \[\leadsto \frac{-x}{B} \]

                                                                                  if 4.20000000000000006e-65 < F

                                                                                  1. Initial program 62.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}} \]
                                                                                    2. lower--.f64N/A

                                                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                    3. *-commutativeN/A

                                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                    4. lower-*.f64N/A

                                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                    5. lower-sqrt.f64N/A

                                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                    6. lower-/.f64N/A

                                                                                      \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                    7. associate-+r+N/A

                                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                    8. +-commutativeN/A

                                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                    9. unpow2N/A

                                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                    10. lower-fma.f64N/A

                                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                    11. +-commutativeN/A

                                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                    12. lower-fma.f6447.0

                                                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                                  5. Applied rewrites47.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 rewrites49.9%

                                                                                      \[\leadsto \frac{1 - x}{B} \]
                                                                                  8. Recombined 3 regimes into one program.
                                                                                  9. Add Preprocessing

                                                                                  Alternative 23: 35.5% accurate, 17.5× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.4 \cdot 10^{-167}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                                  (FPCore (F B x)
                                                                                   :precision binary64
                                                                                   (if (<= F -3.4e-167) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                                  double code(double F, double B, double x) {
                                                                                  	double tmp;
                                                                                  	if (F <= -3.4e-167) {
                                                                                  		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 <= (-3.4d-167)) 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 <= -3.4e-167) {
                                                                                  		tmp = (-1.0 - x) / B;
                                                                                  	} else {
                                                                                  		tmp = -x / B;
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  def code(F, B, x):
                                                                                  	tmp = 0
                                                                                  	if F <= -3.4e-167:
                                                                                  		tmp = (-1.0 - x) / B
                                                                                  	else:
                                                                                  		tmp = -x / B
                                                                                  	return tmp
                                                                                  
                                                                                  function code(F, B, x)
                                                                                  	tmp = 0.0
                                                                                  	if (F <= -3.4e-167)
                                                                                  		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 <= -3.4e-167)
                                                                                  		tmp = (-1.0 - x) / B;
                                                                                  	else
                                                                                  		tmp = -x / B;
                                                                                  	end
                                                                                  	tmp_2 = tmp;
                                                                                  end
                                                                                  
                                                                                  code[F_, B_, x_] := If[LessEqual[F, -3.4e-167], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  \mathbf{if}\;F \leq -3.4 \cdot 10^{-167}:\\
                                                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;\frac{-x}{B}\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 2 regimes
                                                                                  2. if F < -3.3999999999999997e-167

                                                                                    1. Initial program 66.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}} \]
                                                                                      2. lower--.f64N/A

                                                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                      3. *-commutativeN/A

                                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                      4. lower-*.f64N/A

                                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                      5. lower-sqrt.f64N/A

                                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                      6. lower-/.f64N/A

                                                                                        \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                      7. associate-+r+N/A

                                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                      8. +-commutativeN/A

                                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                      9. unpow2N/A

                                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                      10. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                      11. +-commutativeN/A

                                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                      12. lower-fma.f6452.3

                                                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                                    5. Applied rewrites52.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 -inf

                                                                                      \[\leadsto \frac{-1 - x}{B} \]
                                                                                    7. Step-by-step derivation
                                                                                      1. Applied rewrites50.1%

                                                                                        \[\leadsto \frac{-1 - x}{B} \]

                                                                                      if -3.3999999999999997e-167 < F

                                                                                      1. Initial program 77.8%

                                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in B around 0

                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                        2. lower--.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                        3. *-commutativeN/A

                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                        4. lower-*.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                        5. lower-sqrt.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                        6. lower-/.f64N/A

                                                                                          \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                        7. associate-+r+N/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                        8. +-commutativeN/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                        9. unpow2N/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                        10. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                        11. +-commutativeN/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                        12. lower-fma.f6448.5

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                                      5. Applied rewrites48.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{-1 \cdot x}{B} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites36.5%

                                                                                          \[\leadsto \frac{-x}{B} \]
                                                                                      8. Recombined 2 regimes into one program.
                                                                                      9. Add Preprocessing

                                                                                      Alternative 24: 29.6% 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 73.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}} \]
                                                                                        2. lower--.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{B} \]
                                                                                        3. *-commutativeN/A

                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                        4. lower-*.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} - x}{B} \]
                                                                                        5. lower-sqrt.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                        6. lower-/.f64N/A

                                                                                          \[\leadsto \frac{\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot F - x}{B} \]
                                                                                        7. associate-+r+N/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}} \cdot F - x}{B} \]
                                                                                        8. +-commutativeN/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                        9. unpow2N/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}} \cdot F - x}{B} \]
                                                                                        10. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}} \cdot F - x}{B} \]
                                                                                        11. +-commutativeN/A

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                        12. lower-fma.f6449.9

                                                                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}} \cdot F - x}{B} \]
                                                                                      5. Applied rewrites49.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}} \]
                                                                                      6. Taylor expanded in F around 0

                                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites32.8%

                                                                                          \[\leadsto \frac{-x}{B} \]
                                                                                        2. Add Preprocessing

                                                                                        Reproduce

                                                                                        ?
                                                                                        herbie shell --seed 2024346 
                                                                                        (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))))))