VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.4% → 99.6%
Time: 12.3s
Alternatives: 24
Speedup: 1.4×

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.4% 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.6% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, {\left(\sin B \cdot F\right)}^{-1}, t\_0\right)\\


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

    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}{-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.7

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

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

    if -4.00000000000000021e32 < F < 1.00000000000000001e78

    1. Initial program 97.7%

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

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

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

    if 1.00000000000000001e78 < F

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.2% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-86}:\\
\;\;\;\;\frac{F}{\sin B \cdot t\_0}\\

\mathbf{elif}\;t\_2 \leq 0.02:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_2 \leq 20:\\
\;\;\;\;\frac{t\_1}{t\_0}\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_4\\

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


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

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e16 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1.00000000000000008e-86

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

        if -1.00000000000000008e-86 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 0.0200000000000000004 or 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0

        1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            1. Initial program 0.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.f6451.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 rewrites51.7%

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

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

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

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

            Alternative 3: 79.2% accurate, 0.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{B}, \frac{-x}{\tan B}\right)\\ t_1 := \frac{F}{\sin B}\\ t_2 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ t_3 := \sqrt{\mathsf{fma}\left(F, F, 2\right)}\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-86}:\\ \;\;\;\;\frac{F}{\sin B \cdot t\_3}\\ \mathbf{elif}\;t\_2 \leq 0.02:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq 20:\\ \;\;\;\;\frac{t\_1}{t\_3}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0
                     (fma
                      F
                      (/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) B)
                      (/ (- x) (tan B))))
                    (t_1 (/ F (sin B)))
                    (t_2
                     (+
                      (* x (/ -1.0 (tan B)))
                      (* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
                    (t_3 (sqrt (fma F F 2.0))))
               (if (<= t_2 -2e+16)
                 t_0
                 (if (<= t_2 -1e-86)
                   (/ F (* (sin B) t_3))
                   (if (<= t_2 0.02)
                     t_0
                     (if (<= t_2 20.0)
                       (/ t_1 t_3)
                       (if (<= t_2 INFINITY)
                         t_0
                         (/ (- (- (* (/ 0.5 F) (/ (fma 2.0 x 2.0) F)) 1.0) x) B))))))))
            double code(double F, double B, double x) {
            	double t_0 = fma(F, (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / B), (-x / tan(B)));
            	double t_1 = F / sin(B);
            	double t_2 = (x * (-1.0 / tan(B))) + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
            	double t_3 = sqrt(fma(F, F, 2.0));
            	double tmp;
            	if (t_2 <= -2e+16) {
            		tmp = t_0;
            	} else if (t_2 <= -1e-86) {
            		tmp = F / (sin(B) * t_3);
            	} else if (t_2 <= 0.02) {
            		tmp = t_0;
            	} else if (t_2 <= 20.0) {
            		tmp = t_1 / t_3;
            	} else if (t_2 <= ((double) INFINITY)) {
            		tmp = t_0;
            	} else {
            		tmp = ((((0.5 / F) * (fma(2.0, x, 2.0) / F)) - 1.0) - x) / B;
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = fma(F, Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / B), Float64(Float64(-x) / tan(B)))
            	t_1 = Float64(F / sin(B))
            	t_2 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_1 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
            	t_3 = sqrt(fma(F, F, 2.0))
            	tmp = 0.0
            	if (t_2 <= -2e+16)
            		tmp = t_0;
            	elseif (t_2 <= -1e-86)
            		tmp = Float64(F / Float64(sin(B) * t_3));
            	elseif (t_2 <= 0.02)
            		tmp = t_0;
            	elseif (t_2 <= 20.0)
            		tmp = Float64(t_1 / t_3);
            	elseif (t_2 <= Inf)
            		tmp = t_0;
            	else
            		tmp = Float64(Float64(Float64(Float64(Float64(0.5 / F) * Float64(fma(2.0, x, 2.0) / F)) - 1.0) - x) / B);
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, -2e+16], t$95$0, If[LessEqual[t$95$2, -1e-86], N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.02], t$95$0, If[LessEqual[t$95$2, 20.0], N[(t$95$1 / t$95$3), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$0, N[(N[(N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{B}, \frac{-x}{\tan B}\right)\\
            t_1 := \frac{F}{\sin B}\\
            t_2 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
            t_3 := \sqrt{\mathsf{fma}\left(F, F, 2\right)}\\
            \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+16}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-86}:\\
            \;\;\;\;\frac{F}{\sin B \cdot t\_3}\\
            
            \mathbf{elif}\;t\_2 \leq 0.02:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;t\_2 \leq 20:\\
            \;\;\;\;\frac{t\_1}{t\_3}\\
            
            \mathbf{elif}\;t\_2 \leq \infty:\\
            \;\;\;\;t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\left(\frac{0.5}{F} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F} - 1\right) - x}{B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e16 or -1.00000000000000008e-86 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 0.0200000000000000004 or 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0

              1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -2e16 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1.00000000000000008e-86

              1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      1. Initial program 0.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.f6451.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 rewrites51.7%

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

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

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

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

                      Alternative 4: 99.6% accurate, 1.0× speedup?

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

                        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}{-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.7

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

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

                        if -4.00000000000000021e32 < F < 1.00000000000000001e78

                        1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 1.00000000000000001e78 < F

                        1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 5: 99.6% accurate, 1.0× speedup?

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

                        1. Initial program 61.5%

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

                          \[\leadsto \color{blue}{-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.7

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

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

                        if -1.00000000000000003e40 < F < 5.00000000000000046e105

                        1. Initial program 96.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 inf

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

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

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

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

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

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

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

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

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

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

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

                        if 5.00000000000000046e105 < F

                        1. Initial program 45.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 rewrites58.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 F around inf

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

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

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

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

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

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

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

                      Alternative 6: 92.1% accurate, 1.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+21}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 205:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\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 -1e+21)
                         (/ (fma (- x) (cos B) -1.0) (sin B))
                         (if (<= F 205.0)
                           (fma
                            F
                            (/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -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 <= -1e+21) {
                      		tmp = fma(-x, cos(B), -1.0) / sin(B);
                      	} else if (F <= 205.0) {
                      		tmp = fma(F, (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -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 <= -1e+21)
                      		tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B));
                      	elseif (F <= 205.0)
                      		tmp = fma(F, Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -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, -1e+21], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 205.0], N[(F * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $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 \cdot 10^{+21}:\\
                      \;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
                      
                      \mathbf{elif}\;F \leq 205:\\
                      \;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\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 < -1e21

                        1. Initial program 62.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.7

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

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

                        if -1e21 < F < 205

                        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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 205 < 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.f6498.1

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+21}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\ \mathbf{elif}\;F \leq 205:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\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 7: 81.2% accurate, 1.4× speedup?

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

                        1. Initial program 62.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.7

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

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

                        if -1e21 < F < 1.15e172

                        1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 1.15e172 < F

                        1. Initial program 26.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 rewrites43.1%

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

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

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

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

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

                          \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                        9. Step-by-step derivation
                          1. Applied rewrites58.6%

                            \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                        10. Recombined 3 regimes into one program.
                        11. Final simplification81.6%

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

                        Alternative 8: 99.1% accurate, 1.4× speedup?

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

                          1. Initial program 66.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}{-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.f6497.8

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

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

                          if -1.44999999999999996 < F < 1.3600000000000001

                          1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

                            if 1.3600000000000001 < 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.f6498.1

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

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

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

                          Alternative 9: 57.5% accurate, 1.5× speedup?

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

                            1. Initial program 77.1%

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

                            1. Initial program 100.0%

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

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

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

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

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

                            if 1.8e14 < B

                            1. Initial program 89.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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{-1}{F}} \]
                            4. Step-by-step derivation
                              1. lower-/.f6457.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 10: 57.0% accurate, 1.5× speedup?

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

                            1. Initial program 77.1%

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

                            1. Initial program 100.0%

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

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

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

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

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

                            if 1.75e16 < B

                            1. Initial program 88.9%

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{-1}{F}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                              4. lower-fma.f6458.4

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

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

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

                                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{B}}, \frac{-1}{F}, \frac{-x}{\tan B}\right) \]
                            10. Applied rewrites56.8%

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

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

                          Alternative 11: 53.0% accurate, 1.7× speedup?

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

                            1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]

                              if -1.11999999999999995e-5 < F < -2.59999999999999984e-108

                              1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if -2.59999999999999984e-108 < F < 5.6e10

                                1. Initial program 98.8%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. 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.f6445.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 rewrites45.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. Step-by-step derivation
                                  1. Applied rewrites45.0%

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

                                  if 5.6e10 < F

                                  1. Initial program 55.3%

                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                  2. Add Preprocessing
                                  3. 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 rewrites70.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 \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                  6. 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.f6428.9

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

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

                                    \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                  9. Step-by-step derivation
                                    1. Applied rewrites60.5%

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

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

                                  Alternative 12: 53.0% accurate, 1.7× speedup?

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

                                    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]

                                      if -1.11999999999999995e-5 < F < -2.59999999999999984e-108

                                      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -2.59999999999999984e-108 < F < 5.6e10

                                        1. Initial program 98.8%

                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        2. 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.f6445.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 rewrites45.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. Step-by-step derivation
                                          1. Applied rewrites45.0%

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

                                          if 5.6e10 < F

                                          1. Initial program 55.3%

                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          2. Add Preprocessing
                                          3. 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 rewrites70.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 \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                          6. 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.f6428.9

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

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

                                            \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                          9. Step-by-step derivation
                                            1. Applied rewrites60.5%

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

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

                                          Alternative 13: 52.9% accurate, 1.7× speedup?

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

                                            1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                            9. Step-by-step derivation
                                              1. Applied rewrites57.5%

                                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]

                                              if -1e21 < F < 5.6e10

                                              1. Initial program 98.9%

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

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

                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                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.f6445.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 rewrites45.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}} \]

                                              if 5.6e10 < F

                                              1. Initial program 55.3%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Add Preprocessing
                                              3. 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 rewrites70.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 \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                              6. 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.f6428.9

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

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

                                                \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                              9. Step-by-step derivation
                                                1. Applied rewrites60.5%

                                                  \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                                              10. Recombined 3 regimes into one program.
                                              11. Final simplification51.6%

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

                                              Alternative 14: 57.0% accurate, 2.0× speedup?

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

                                                1. Initial program 77.1%

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

                                                1. Initial program 100.0%

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

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

                                                  \[\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 \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                6. 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.f6476.6

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

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

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

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

                                                    if 6.5e16 < B

                                                    1. Initial program 88.9%

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

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

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

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

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

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

                                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{-1}{F}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      4. lower-fma.f6458.4

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

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

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

                                                        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{B}}, \frac{-1}{F}, \frac{-x}{\tan B}\right) \]
                                                    10. Applied rewrites56.8%

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

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

                                                  Alternative 15: 51.2% accurate, 2.0× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.85:\\ \;\;\;\;\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{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\ \end{array} \end{array} \]
                                                  (FPCore (F B x)
                                                   :precision binary64
                                                   (if (<= B 0.85)
                                                     (/
                                                      (-
                                                       (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)
                                                     (/ F (* (sin B) (sqrt (fma F F 2.0))))))
                                                  double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (B <= 0.85) {
                                                  		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 = F / (sin(B) * sqrt(fma(F, F, 2.0)));
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(F, B, x)
                                                  	tmp = 0.0
                                                  	if (B <= 0.85)
                                                  		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(F / Float64(sin(B) * sqrt(fma(F, F, 2.0))));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[F_, B_, x_] := If[LessEqual[B, 0.85], 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[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;B \leq 0.85:\\
                                                  \;\;\;\;\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{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if B < 0.849999999999999978

                                                    1. Initial program 77.1%

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

                                                    1. Initial program 89.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 rewrites89.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 \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                                                    6. 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.f6433.5

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

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

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

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

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.85:\\ \;\;\;\;\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{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\ \end{array} \]
                                                      5. Add Preprocessing

                                                      Alternative 16: 51.2% accurate, 2.4× speedup?

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

                                                        1. Initial program 66.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.f6432.8

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

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

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

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

                                                          if -1.11999999999999995e-5 < F < 3.80000000000000021e164

                                                          1. Initial program 95.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.f6445.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 rewrites45.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}} \]

                                                          if 3.80000000000000021e164 < F

                                                          1. Initial program 27.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          Alternative 17: 51.2% accurate, 2.5× speedup?

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

                                                            1. Initial program 66.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.f6432.8

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

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

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

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

                                                              if -1.11999999999999995e-5 < F < 700

                                                              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.f6443.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 rewrites43.2%

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

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

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

                                                                if 700 < F

                                                                1. Initial program 55.3%

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

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

                                                                    \[\leadsto \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.f6438.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 rewrites38.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 \left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{B \cdot {F}^{2}} + \frac{1}{B}\right) - \color{blue}{\frac{x}{B}} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites42.2%

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

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

                                                                      \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites48.2%

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

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

                                                                    Alternative 18: 51.0% accurate, 2.5× speedup?

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

                                                                      1. Initial program 67.7%

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

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

                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                        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.f6431.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 rewrites31.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 -inf

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

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

                                                                        if -2.2999999999999999e-16 < F < 700

                                                                        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.f6443.8

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

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

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

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

                                                                          if 700 < F

                                                                          1. Initial program 55.3%

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

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

                                                                              \[\leadsto \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.f6438.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 rewrites38.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 \left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{B \cdot {F}^{2}} + \frac{1}{B}\right) - \color{blue}{\frac{x}{B}} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites42.2%

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

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

                                                                                \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites48.2%

                                                                                  \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                                                                              4. Recombined 3 regimes into one program.
                                                                              5. Final simplification45.7%

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

                                                                              Alternative 19: 52.0% accurate, 2.5× speedup?

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

                                                                                1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                  \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                                                                                9. Step-by-step derivation
                                                                                  1. Applied rewrites57.5%

                                                                                    \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]

                                                                                  if -1e21 < F < 3.80000000000000021e164

                                                                                  1. Initial program 95.7%

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

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

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

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

                                                                                    if 3.80000000000000021e164 < F

                                                                                    1. Initial program 27.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                        \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{\color{blue}{B}} \]
                                                                                    11. Recombined 3 regimes into one program.
                                                                                    12. Final simplification48.0%

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

                                                                                    Alternative 20: 51.2% accurate, 2.5× speedup?

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

                                                                                      1. Initial program 66.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.f6432.8

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

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

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

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

                                                                                        if -1.11999999999999995e-5 < F < 3.80000000000000021e164

                                                                                        1. Initial program 95.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.f6445.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 rewrites45.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. Step-by-step derivation
                                                                                          1. Applied rewrites45.3%

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

                                                                                          if 3.80000000000000021e164 < F

                                                                                          1. Initial program 27.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \left(-x \cdot \frac{1}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{\color{blue}{B}} \]
                                                                                          11. Recombined 3 regimes into one program.
                                                                                          12. Final simplification46.0%

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

                                                                                          Alternative 21: 43.7% accurate, 2.9× speedup?

                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{-108}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1} - \frac{x}{B}\\ \end{array} \end{array} \]
                                                                                          (FPCore (F B x)
                                                                                           :precision binary64
                                                                                           (if (<= F -4.5e-108)
                                                                                             (/ (- -1.0 x) B)
                                                                                             (if (<= F 5.2e-44) (/ (- x) B) (- (pow B -1.0) (/ x B)))))
                                                                                          double code(double F, double B, double x) {
                                                                                          	double tmp;
                                                                                          	if (F <= -4.5e-108) {
                                                                                          		tmp = (-1.0 - x) / B;
                                                                                          	} else if (F <= 5.2e-44) {
                                                                                          		tmp = -x / B;
                                                                                          	} else {
                                                                                          		tmp = pow(B, -1.0) - (x / B);
                                                                                          	}
                                                                                          	return tmp;
                                                                                          }
                                                                                          
                                                                                          module fmin_fmax_functions
                                                                                              implicit none
                                                                                              private
                                                                                              public fmax
                                                                                              public fmin
                                                                                          
                                                                                              interface fmax
                                                                                                  module procedure fmax88
                                                                                                  module procedure fmax44
                                                                                                  module procedure fmax84
                                                                                                  module procedure fmax48
                                                                                              end interface
                                                                                              interface fmin
                                                                                                  module procedure fmin88
                                                                                                  module procedure fmin44
                                                                                                  module procedure fmin84
                                                                                                  module procedure fmin48
                                                                                              end interface
                                                                                          contains
                                                                                              real(8) function fmax88(x, y) result (res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(4) function fmax44(x, y) result (res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmax84(x, y) result(res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmax48(x, y) result(res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmin88(x, y) result (res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(4) function fmin44(x, y) result (res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmin84(x, y) result(res)
                                                                                                  real(8), intent (in) :: x
                                                                                                  real(4), intent (in) :: y
                                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                              end function
                                                                                              real(8) function fmin48(x, y) result(res)
                                                                                                  real(4), intent (in) :: x
                                                                                                  real(8), intent (in) :: y
                                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                              end function
                                                                                          end module
                                                                                          
                                                                                          real(8) function code(f, b, x)
                                                                                          use fmin_fmax_functions
                                                                                              real(8), intent (in) :: f
                                                                                              real(8), intent (in) :: b
                                                                                              real(8), intent (in) :: x
                                                                                              real(8) :: tmp
                                                                                              if (f <= (-4.5d-108)) then
                                                                                                  tmp = ((-1.0d0) - x) / b
                                                                                              else if (f <= 5.2d-44) then
                                                                                                  tmp = -x / b
                                                                                              else
                                                                                                  tmp = (b ** (-1.0d0)) - (x / b)
                                                                                              end if
                                                                                              code = tmp
                                                                                          end function
                                                                                          
                                                                                          public static double code(double F, double B, double x) {
                                                                                          	double tmp;
                                                                                          	if (F <= -4.5e-108) {
                                                                                          		tmp = (-1.0 - x) / B;
                                                                                          	} else if (F <= 5.2e-44) {
                                                                                          		tmp = -x / B;
                                                                                          	} else {
                                                                                          		tmp = Math.pow(B, -1.0) - (x / B);
                                                                                          	}
                                                                                          	return tmp;
                                                                                          }
                                                                                          
                                                                                          def code(F, B, x):
                                                                                          	tmp = 0
                                                                                          	if F <= -4.5e-108:
                                                                                          		tmp = (-1.0 - x) / B
                                                                                          	elif F <= 5.2e-44:
                                                                                          		tmp = -x / B
                                                                                          	else:
                                                                                          		tmp = math.pow(B, -1.0) - (x / B)
                                                                                          	return tmp
                                                                                          
                                                                                          function code(F, B, x)
                                                                                          	tmp = 0.0
                                                                                          	if (F <= -4.5e-108)
                                                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                          	elseif (F <= 5.2e-44)
                                                                                          		tmp = Float64(Float64(-x) / B);
                                                                                          	else
                                                                                          		tmp = Float64((B ^ -1.0) - Float64(x / B));
                                                                                          	end
                                                                                          	return tmp
                                                                                          end
                                                                                          
                                                                                          function tmp_2 = code(F, B, x)
                                                                                          	tmp = 0.0;
                                                                                          	if (F <= -4.5e-108)
                                                                                          		tmp = (-1.0 - x) / B;
                                                                                          	elseif (F <= 5.2e-44)
                                                                                          		tmp = -x / B;
                                                                                          	else
                                                                                          		tmp = (B ^ -1.0) - (x / B);
                                                                                          	end
                                                                                          	tmp_2 = tmp;
                                                                                          end
                                                                                          
                                                                                          code[F_, B_, x_] := If[LessEqual[F, -4.5e-108], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.2e-44], N[((-x) / B), $MachinePrecision], N[(N[Power[B, -1.0], $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
                                                                                          
                                                                                          \begin{array}{l}
                                                                                          
                                                                                          \\
                                                                                          \begin{array}{l}
                                                                                          \mathbf{if}\;F \leq -4.5 \cdot 10^{-108}:\\
                                                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                                                          
                                                                                          \mathbf{elif}\;F \leq 5.2 \cdot 10^{-44}:\\
                                                                                          \;\;\;\;\frac{-x}{B}\\
                                                                                          
                                                                                          \mathbf{else}:\\
                                                                                          \;\;\;\;{B}^{-1} - \frac{x}{B}\\
                                                                                          
                                                                                          
                                                                                          \end{array}
                                                                                          \end{array}
                                                                                          
                                                                                          Derivation
                                                                                          1. Split input into 3 regimes
                                                                                          2. if F < -4.4999999999999997e-108

                                                                                            1. Initial program 73.9%

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

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

                                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                              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.f6433.8

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

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

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

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

                                                                                              if -4.4999999999999997e-108 < F < 5.1999999999999996e-44

                                                                                              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.f6444.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 rewrites44.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 rewrites40.2%

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

                                                                                                if 5.1999999999999996e-44 < F

                                                                                                1. Initial program 61.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.f6437.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 rewrites37.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 inf

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

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

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

                                                                                                      \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites42.8%

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

                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{-108}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;{B}^{-1} - \frac{x}{B}\\ \end{array} \]
                                                                                                    6. Add Preprocessing

                                                                                                    Alternative 22: 43.7% accurate, 13.6× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{-108}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                                                    (FPCore (F B x)
                                                                                                     :precision binary64
                                                                                                     (if (<= F -4.5e-108)
                                                                                                       (/ (- -1.0 x) B)
                                                                                                       (if (<= F 5.2e-44) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                                                    double code(double F, double B, double x) {
                                                                                                    	double tmp;
                                                                                                    	if (F <= -4.5e-108) {
                                                                                                    		tmp = (-1.0 - x) / B;
                                                                                                    	} else if (F <= 5.2e-44) {
                                                                                                    		tmp = -x / B;
                                                                                                    	} else {
                                                                                                    		tmp = (1.0 - x) / B;
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    module fmin_fmax_functions
                                                                                                        implicit none
                                                                                                        private
                                                                                                        public fmax
                                                                                                        public fmin
                                                                                                    
                                                                                                        interface fmax
                                                                                                            module procedure fmax88
                                                                                                            module procedure fmax44
                                                                                                            module procedure fmax84
                                                                                                            module procedure fmax48
                                                                                                        end interface
                                                                                                        interface fmin
                                                                                                            module procedure fmin88
                                                                                                            module procedure fmin44
                                                                                                            module procedure fmin84
                                                                                                            module procedure fmin48
                                                                                                        end interface
                                                                                                    contains
                                                                                                        real(8) function fmax88(x, y) result (res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(4) function fmax44(x, y) result (res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmax84(x, y) result(res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmax48(x, y) result(res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmin88(x, y) result (res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(4) function fmin44(x, y) result (res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmin84(x, y) result(res)
                                                                                                            real(8), intent (in) :: x
                                                                                                            real(4), intent (in) :: y
                                                                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                        end function
                                                                                                        real(8) function fmin48(x, y) result(res)
                                                                                                            real(4), intent (in) :: x
                                                                                                            real(8), intent (in) :: y
                                                                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                        end function
                                                                                                    end module
                                                                                                    
                                                                                                    real(8) function code(f, b, x)
                                                                                                    use fmin_fmax_functions
                                                                                                        real(8), intent (in) :: f
                                                                                                        real(8), intent (in) :: b
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8) :: tmp
                                                                                                        if (f <= (-4.5d-108)) then
                                                                                                            tmp = ((-1.0d0) - x) / b
                                                                                                        else if (f <= 5.2d-44) then
                                                                                                            tmp = -x / b
                                                                                                        else
                                                                                                            tmp = (1.0d0 - x) / b
                                                                                                        end if
                                                                                                        code = tmp
                                                                                                    end function
                                                                                                    
                                                                                                    public static double code(double F, double B, double x) {
                                                                                                    	double tmp;
                                                                                                    	if (F <= -4.5e-108) {
                                                                                                    		tmp = (-1.0 - x) / B;
                                                                                                    	} else if (F <= 5.2e-44) {
                                                                                                    		tmp = -x / B;
                                                                                                    	} else {
                                                                                                    		tmp = (1.0 - x) / B;
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(F, B, x):
                                                                                                    	tmp = 0
                                                                                                    	if F <= -4.5e-108:
                                                                                                    		tmp = (-1.0 - x) / B
                                                                                                    	elif F <= 5.2e-44:
                                                                                                    		tmp = -x / B
                                                                                                    	else:
                                                                                                    		tmp = (1.0 - x) / B
                                                                                                    	return tmp
                                                                                                    
                                                                                                    function code(F, B, x)
                                                                                                    	tmp = 0.0
                                                                                                    	if (F <= -4.5e-108)
                                                                                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                                    	elseif (F <= 5.2e-44)
                                                                                                    		tmp = Float64(Float64(-x) / B);
                                                                                                    	else
                                                                                                    		tmp = Float64(Float64(1.0 - x) / B);
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    function tmp_2 = code(F, B, x)
                                                                                                    	tmp = 0.0;
                                                                                                    	if (F <= -4.5e-108)
                                                                                                    		tmp = (-1.0 - x) / B;
                                                                                                    	elseif (F <= 5.2e-44)
                                                                                                    		tmp = -x / B;
                                                                                                    	else
                                                                                                    		tmp = (1.0 - x) / B;
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[F_, B_, x_] := If[LessEqual[F, -4.5e-108], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.2e-44], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    \mathbf{if}\;F \leq -4.5 \cdot 10^{-108}:\\
                                                                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                                                                    
                                                                                                    \mathbf{elif}\;F \leq 5.2 \cdot 10^{-44}:\\
                                                                                                    \;\;\;\;\frac{-x}{B}\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;\frac{1 - x}{B}\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 3 regimes
                                                                                                    2. if F < -4.4999999999999997e-108

                                                                                                      1. Initial program 73.9%

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

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

                                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                        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.f6433.8

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

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

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

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

                                                                                                        if -4.4999999999999997e-108 < F < 5.1999999999999996e-44

                                                                                                        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.f6444.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 rewrites44.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 rewrites40.2%

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

                                                                                                          if 5.1999999999999996e-44 < F

                                                                                                          1. Initial program 61.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.f6437.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 rewrites37.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 inf

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

                                                                                                              \[\leadsto \frac{1 - x}{B} \]
                                                                                                          8. Recombined 3 regimes into one program.
                                                                                                          9. Add Preprocessing

                                                                                                          Alternative 23: 36.7% accurate, 17.5× speedup?

                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{-108}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                                                          (FPCore (F B x)
                                                                                                           :precision binary64
                                                                                                           (if (<= F -4.5e-108) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                                                          double code(double F, double B, double x) {
                                                                                                          	double tmp;
                                                                                                          	if (F <= -4.5e-108) {
                                                                                                          		tmp = (-1.0 - x) / B;
                                                                                                          	} else {
                                                                                                          		tmp = -x / B;
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          module fmin_fmax_functions
                                                                                                              implicit none
                                                                                                              private
                                                                                                              public fmax
                                                                                                              public fmin
                                                                                                          
                                                                                                              interface fmax
                                                                                                                  module procedure fmax88
                                                                                                                  module procedure fmax44
                                                                                                                  module procedure fmax84
                                                                                                                  module procedure fmax48
                                                                                                              end interface
                                                                                                              interface fmin
                                                                                                                  module procedure fmin88
                                                                                                                  module procedure fmin44
                                                                                                                  module procedure fmin84
                                                                                                                  module procedure fmin48
                                                                                                              end interface
                                                                                                          contains
                                                                                                              real(8) function fmax88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmax44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmax48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin88(x, y) result (res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(4) function fmin44(x, y) result (res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin84(x, y) result(res)
                                                                                                                  real(8), intent (in) :: x
                                                                                                                  real(4), intent (in) :: y
                                                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                              end function
                                                                                                              real(8) function fmin48(x, y) result(res)
                                                                                                                  real(4), intent (in) :: x
                                                                                                                  real(8), intent (in) :: y
                                                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                              end function
                                                                                                          end module
                                                                                                          
                                                                                                          real(8) function code(f, b, x)
                                                                                                          use fmin_fmax_functions
                                                                                                              real(8), intent (in) :: f
                                                                                                              real(8), intent (in) :: b
                                                                                                              real(8), intent (in) :: x
                                                                                                              real(8) :: tmp
                                                                                                              if (f <= (-4.5d-108)) then
                                                                                                                  tmp = ((-1.0d0) - x) / b
                                                                                                              else
                                                                                                                  tmp = -x / b
                                                                                                              end if
                                                                                                              code = tmp
                                                                                                          end function
                                                                                                          
                                                                                                          public static double code(double F, double B, double x) {
                                                                                                          	double tmp;
                                                                                                          	if (F <= -4.5e-108) {
                                                                                                          		tmp = (-1.0 - x) / B;
                                                                                                          	} else {
                                                                                                          		tmp = -x / B;
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          def code(F, B, x):
                                                                                                          	tmp = 0
                                                                                                          	if F <= -4.5e-108:
                                                                                                          		tmp = (-1.0 - x) / B
                                                                                                          	else:
                                                                                                          		tmp = -x / B
                                                                                                          	return tmp
                                                                                                          
                                                                                                          function code(F, B, x)
                                                                                                          	tmp = 0.0
                                                                                                          	if (F <= -4.5e-108)
                                                                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                                          	else
                                                                                                          		tmp = Float64(Float64(-x) / B);
                                                                                                          	end
                                                                                                          	return tmp
                                                                                                          end
                                                                                                          
                                                                                                          function tmp_2 = code(F, B, x)
                                                                                                          	tmp = 0.0;
                                                                                                          	if (F <= -4.5e-108)
                                                                                                          		tmp = (-1.0 - x) / B;
                                                                                                          	else
                                                                                                          		tmp = -x / B;
                                                                                                          	end
                                                                                                          	tmp_2 = tmp;
                                                                                                          end
                                                                                                          
                                                                                                          code[F_, B_, x_] := If[LessEqual[F, -4.5e-108], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          
                                                                                                          \\
                                                                                                          \begin{array}{l}
                                                                                                          \mathbf{if}\;F \leq -4.5 \cdot 10^{-108}:\\
                                                                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;\frac{-x}{B}\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 2 regimes
                                                                                                          2. if F < -4.4999999999999997e-108

                                                                                                            1. Initial program 73.9%

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

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

                                                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                                              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.f6433.8

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

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

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

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

                                                                                                              if -4.4999999999999997e-108 < F

                                                                                                              1. Initial program 83.1%

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

                                                                                                                  \[\leadsto \frac{-x}{B} \]
                                                                                                              8. Recombined 2 regimes into one program.
                                                                                                              9. Add Preprocessing

                                                                                                              Alternative 24: 29.8% 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 80.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.f6439.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 rewrites39.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 rewrites26.4%

                                                                                                                  \[\leadsto \frac{-x}{B} \]
                                                                                                                2. Add Preprocessing

                                                                                                                Reproduce

                                                                                                                ?
                                                                                                                herbie shell --seed 2024359 
                                                                                                                (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))))))