VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.6%
Time: 10.8s
Alternatives: 18
Speedup: 1.6×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 76.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.6% accurate, 1.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, 1\right)}{\sin B}\\


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

    1. Initial program 24.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e155 < F < 5.00000000000000027e31

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000027e31 < F

    1. Initial program 52.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 rewrites62.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 F around inf

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.0% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.00029:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, \sqrt{0.5} \cdot F\right)}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, 1\right)}{\sin B}\\


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

    1. Initial program 46.4%

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

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

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

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

    if -1.3999999999999999 < F < 2.9e-4

    1. Initial program 99.4%

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

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

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

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

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

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

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

        if 2.9e-4 < F

        1. Initial program 56.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 rewrites66.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 \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
        6. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 92.2% accurate, 1.5× speedup?

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

        1. Initial program 47.0%

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

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

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

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

        if -0.034000000000000002 < F < -1.55000000000000005e-130

        1. Initial program 99.3%

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

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

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

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

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

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

          if -1.55000000000000005e-130 < F < 2.9e-4

          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 2.9e-4 < F

          1. Initial program 56.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 rewrites66.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 \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B} + \frac{1}{\sin B}} \]
          6. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 83.8% accurate, 1.6× speedup?

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

          1. Initial program 47.0%

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

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

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

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

          if -0.034000000000000002 < F < -1.55000000000000005e-130

          1. Initial program 99.3%

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

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

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

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

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

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

            if -1.55000000000000005e-130 < F < 4.60000000000000025e45

            1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 4.60000000000000025e45 < F < 5.5000000000000001e155

            1. Initial program 74.6%

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

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

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

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

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

              if 5.5000000000000001e155 < F

              1. Initial program 36.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 5: 70.9% accurate, 2.1× speedup?

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

                1. Initial program 37.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 rewrites50.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.f6412.1

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

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

                  if -2.9000000000000001e90 < F < 4.60000000000000025e45

                  1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 4.60000000000000025e45 < F < 5.5000000000000001e155

                  1. Initial program 74.6%

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

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

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

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

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

                    if 5.5000000000000001e155 < F

                    1. Initial program 36.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 6: 67.9% accurate, 2.1× speedup?

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

                      1. Initial program 37.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 rewrites50.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.f6412.1

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

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

                        if -9.1999999999999996e89 < F < 3350

                        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 3350 < F < 5.5000000000000001e155

                          1. Initial program 82.6%

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

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

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

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

                            if 5.5000000000000001e155 < F

                            1. Initial program 36.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 7: 68.1% accurate, 2.3× speedup?

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

                              1. Initial program 37.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 rewrites50.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.f6412.1

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

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

                                if -2.9000000000000001e90 < F < 3350

                                1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 3350 < F < 5.5000000000000001e155

                                    1. Initial program 82.6%

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

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

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

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

                                      if 5.5000000000000001e155 < F

                                      1. Initial program 36.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+90}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 3350:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{+155}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 8: 68.0% accurate, 2.4× speedup?

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

                                        1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if -5.6e-91 < x < -4.1000000000000001e-174

                                          1. Initial program 51.2%

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

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

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

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

                                            if -4.1000000000000001e-174 < x < 9.00000000000000008e-85

                                            1. Initial program 64.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 rewrites67.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.f6453.1

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

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

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

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

                                            Alternative 9: 55.9% accurate, 2.7× speedup?

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

                                              1. Initial program 64.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.f6448.6

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

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

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

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

                                                if 1.12e-39 < B

                                                1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                Alternative 10: 52.2% accurate, 3.0× speedup?

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

                                                  1. Initial program 37.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 rewrites50.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.f6412.1

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

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

                                                    if -5.49999999999999999e90 < F < 6.2e5

                                                    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    if 6.2e5 < F

                                                    1. Initial program 56.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 rewrites65.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.f6425.4

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

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

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

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

                                                    Alternative 11: 51.9% accurate, 3.1× speedup?

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

                                                      1. Initial program 37.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 rewrites50.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.f6412.1

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

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

                                                        if -5.49999999999999999e90 < F < 2e21

                                                        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                          12. lower-fma.f6448.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 rewrites48.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 2e21 < F

                                                        1. Initial program 53.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.f6423.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 rewrites23.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 \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 rewrites34.8%

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

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

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

                                                          Alternative 12: 52.0% accurate, 5.7× speedup?

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

                                                            1. Initial program 22.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.f6415.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 rewrites15.0%

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

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

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

                                                              if -1.19999999999999996e166 < F < 2e21

                                                              1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                12. lower-fma.f6446.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 rewrites46.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 2e21 < F

                                                              1. Initial program 53.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.f6423.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 rewrites23.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 \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 rewrites34.8%

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

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

                                                                Alternative 13: 52.0% accurate, 6.1× speedup?

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

                                                                  1. Initial program 22.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.f6415.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 rewrites15.0%

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

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

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

                                                                    if -1.19999999999999996e166 < F < 9.00000000000000018e154

                                                                    1. Initial program 93.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.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. Step-by-step derivation
                                                                      1. Applied rewrites44.9%

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

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

                                                                      if 9.00000000000000018e154 < F

                                                                      1. Initial program 36.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.f6416.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 rewrites16.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 rewrites33.7%

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

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

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

                                                                        Alternative 14: 51.9% accurate, 6.1× speedup?

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

                                                                          1. Initial program 46.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.f6425.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 rewrites25.5%

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

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

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

                                                                            if -1.3999999999999999 < F < 2.9e-4

                                                                            1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              if 2.9e-4 < F

                                                                              1. Initial program 56.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.f6426.6

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

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

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

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

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

                                                                                Alternative 15: 51.9% accurate, 6.2× speedup?

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

                                                                                  1. Initial program 46.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.f6425.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 rewrites25.5%

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

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

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

                                                                                    if -1.3999999999999999 < F < 2.9e-4

                                                                                    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      if 2.9e-4 < F

                                                                                      1. Initial program 56.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.f6426.6

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

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

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

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

                                                                                      Alternative 16: 44.5% accurate, 13.6× speedup?

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

                                                                                        1. Initial program 51.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.f6426.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 rewrites26.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 rewrites47.3%

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

                                                                                          if -1.2000000000000001e-75 < F < 4.00000000000000015e-89

                                                                                          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.f6447.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 rewrites47.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 rewrites35.0%

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

                                                                                            if 4.00000000000000015e-89 < F

                                                                                            1. Initial program 63.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.f6430.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 rewrites30.0%

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

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

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

                                                                                            Alternative 17: 37.3% accurate, 17.5× speedup?

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

                                                                                              1. Initial program 51.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.f6426.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 rewrites26.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 rewrites47.3%

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

                                                                                                if -1.2000000000000001e-75 < F

                                                                                                1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}} \cdot F - x}{B} \]
                                                                                                  12. lower-fma.f6439.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 rewrites39.1%

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

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

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

                                                                                                Alternative 18: 30.2% accurate, 26.3× speedup?

                                                                                                \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                                                                (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                                                                double code(double F, double B, double x) {
                                                                                                	return -x / B;
                                                                                                }
                                                                                                
                                                                                                module fmin_fmax_functions
                                                                                                    implicit none
                                                                                                    private
                                                                                                    public fmax
                                                                                                    public fmin
                                                                                                
                                                                                                    interface fmax
                                                                                                        module procedure fmax88
                                                                                                        module procedure fmax44
                                                                                                        module procedure fmax84
                                                                                                        module procedure fmax48
                                                                                                    end interface
                                                                                                    interface fmin
                                                                                                        module procedure fmin88
                                                                                                        module procedure fmin44
                                                                                                        module procedure fmin84
                                                                                                        module procedure fmin48
                                                                                                    end interface
                                                                                                contains
                                                                                                    real(8) function fmax88(x, y) result (res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(4) function fmax44(x, y) result (res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmax84(x, y) result(res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmax48(x, y) result(res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin88(x, y) result (res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(4) function fmin44(x, y) result (res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin84(x, y) result(res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin48(x, y) result(res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                    end function
                                                                                                end module
                                                                                                
                                                                                                real(8) function code(f, b, x)
                                                                                                use fmin_fmax_functions
                                                                                                    real(8), intent (in) :: f
                                                                                                    real(8), intent (in) :: b
                                                                                                    real(8), intent (in) :: x
                                                                                                    code = -x / b
                                                                                                end function
                                                                                                
                                                                                                public static double code(double F, double B, double x) {
                                                                                                	return -x / B;
                                                                                                }
                                                                                                
                                                                                                def code(F, B, x):
                                                                                                	return -x / B
                                                                                                
                                                                                                function code(F, B, x)
                                                                                                	return Float64(Float64(-x) / B)
                                                                                                end
                                                                                                
                                                                                                function tmp = code(F, B, x)
                                                                                                	tmp = -x / B;
                                                                                                end
                                                                                                
                                                                                                code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                
                                                                                                \\
                                                                                                \frac{-x}{B}
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Initial program 71.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.f6434.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 rewrites34.7%

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

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

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

                                                                                                  Reproduce

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