VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.0% → 99.4%
Time: 19.3s
Alternatives: 32
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
    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 32 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.0% 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)));
}
real(8) function code(f, b, x)
    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.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -50000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -5e10 < F < 0.00619999999999999978

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.7%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} - \frac{x}{\tan B} \]
      2. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}} - \frac{x}{\tan B} \]
      3. *-commutative99.7%

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

        \[\leadsto {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} - \frac{x}{\tan B} \]
      5. un-div-inv99.7%

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

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

        \[\leadsto \frac{{\color{blue}{\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}}^{-0.5}}{\frac{\sin B}{F}} - \frac{x}{\tan B} \]
      8. *-commutative99.7%

        \[\leadsto \frac{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{-0.5}}{\frac{\sin B}{F}} - \frac{x}{\tan B} \]
      9. fma-define99.7%

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

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

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

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

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

Alternative 2: 99.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -42000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -4.2e10 < F < 9.99999999999999954e36

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

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

    if 9.99999999999999954e36 < F

    1. Initial program 55.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. Simplified67.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.9%

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

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

Alternative 3: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.8 \cdot 10^{+36}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -36000000000.0)
   (- (/ -1.0 (sin B)) (/ (* x (cos B)) (sin B)))
   (if (<= F 7.8e+36)
     (+
      (* x (/ -1.0 (tan B)))
      (* (/ 1.0 (/ (sin B) F)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
     (- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	} else if (F <= 7.8e+36) {
		tmp = (x * (-1.0 / tan(B))) + ((1.0 / (sin(B) / F)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
	} else {
		tmp = (1.0 / sin(B)) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - ((x * cos(b)) / sin(b))
    else if (f <= 7.8d+36) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((1.0d0 / (sin(b) / f)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
    else
        tmp = (1.0d0 / sin(b)) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
	} else if (F <= 7.8e+36) {
		tmp = (x * (-1.0 / Math.tan(B))) + ((1.0 / (Math.sin(B) / F)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B))
	elif F <= 7.8e+36:
		tmp = (x * (-1.0 / math.tan(B))) + ((1.0 / (math.sin(B) / F)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5))
	else:
		tmp = (1.0 / math.sin(B)) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B)));
	elseif (F <= 7.8e+36)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(1.0 / Float64(sin(B) / F)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	elseif (F <= 7.8e+36)
		tmp = (x * (-1.0 / tan(B))) + ((1.0 / (sin(B) / F)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5));
	else
		tmp = (1.0 / sin(B)) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.8e+36], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 7.8 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\

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


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -3.6e10 < F < 7.80000000000000042e36

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.5%

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\frac{\sin B}{F}\right)}^{-1}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Step-by-step derivation
      1. unpow-199.5%

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

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

    if 7.80000000000000042e36 < F

    1. Initial program 55.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. Simplified67.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.9%

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -50000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+33}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -50000000000.0)
   (- (/ -1.0 (sin B)) (/ (* x (cos B)) (sin B)))
   (if (<= F 2.2e+33)
     (+
      (* x (/ -1.0 (tan B)))
      (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F (sin B))))
     (- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -50000000000.0) {
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	} else if (F <= 2.2e+33) {
		tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / sin(B)));
	} else {
		tmp = (1.0 / sin(B)) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-50000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - ((x * cos(b)) / sin(b))
    else if (f <= 2.2d+33) then
        tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / sin(b)))
    else
        tmp = (1.0d0 / sin(b)) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -50000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
	} else if (F <= 2.2e+33) {
		tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / Math.sin(B)));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -50000000000.0:
		tmp = (-1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B))
	elif F <= 2.2e+33:
		tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / math.sin(B)))
	else:
		tmp = (1.0 / math.sin(B)) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -50000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B)));
	elseif (F <= 2.2e+33)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / sin(B))));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -50000000000.0)
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	elseif (F <= 2.2e+33)
		tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / sin(B)));
	else
		tmp = (1.0 / sin(B)) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -50000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.2e+33], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -50000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 2.2 \cdot 10^{+33}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B}\\

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


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -5e10 < F < 2.19999999999999994e33

    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

    if 2.19999999999999994e33 < F

    1. Initial program 57.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. Simplified68.8%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.9%

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

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

Alternative 5: 99.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -60000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+33}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -60000000000.0)
   (- (/ -1.0 (sin B)) (/ (* x (cos B)) (sin B)))
   (if (<= F 2.2e+33)
     (-
      (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F (sin B)))
      (/ 1.0 (/ (tan B) x)))
     (- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -60000000000.0) {
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	} else if (F <= 2.2e+33) {
		tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / sin(B))) - (1.0 / (tan(B) / x));
	} else {
		tmp = (1.0 / sin(B)) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-60000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - ((x * cos(b)) / sin(b))
    else if (f <= 2.2d+33) then
        tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / sin(b))) - (1.0d0 / (tan(b) / x))
    else
        tmp = (1.0d0 / sin(b)) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -60000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
	} else if (F <= 2.2e+33) {
		tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / Math.sin(B))) - (1.0 / (Math.tan(B) / x));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -60000000000.0:
		tmp = (-1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B))
	elif F <= 2.2e+33:
		tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / math.sin(B))) - (1.0 / (math.tan(B) / x))
	else:
		tmp = (1.0 / math.sin(B)) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -60000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B)));
	elseif (F <= 2.2e+33)
		tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(1.0 / Float64(tan(B) / x)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -60000000000.0)
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	elseif (F <= 2.2e+33)
		tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / sin(B))) - (1.0 / (tan(B) / x));
	else
		tmp = (1.0 / sin(B)) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -60000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.2e+33], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -60000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 2.2 \cdot 10^{+33}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{1}{\frac{\tan B}{x}}\\

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


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -6e10 < F < 2.19999999999999994e33

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv99.7%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. neg-mul-199.7%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      3. clear-num99.5%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\tan B}{x}}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      4. un-div-inv99.5%

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

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

    if 2.19999999999999994e33 < F

    1. Initial program 57.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. Simplified68.8%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.9%

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

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

Alternative 6: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (- (/ -1.0 (sin B)) (/ (* x (cos B)) (sin B)))
     (if (<= F 0.0062)
       (- (/ F (/ (sin B) (sqrt 0.5))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	} else if (F <= 0.0062) {
		tmp = (F / (sin(B) / sqrt(0.5))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - ((x * cos(b)) / sin(b))
    else if (f <= 0.0062d0) then
        tmp = (f / (sin(b) / sqrt(0.5d0))) - t_0
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
	} else if (F <= 0.0062) {
		tmp = (F / (Math.sin(B) / Math.sqrt(0.5))) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B))
	elif F <= 0.0062:
		tmp = (F / (math.sin(B) / math.sqrt(0.5))) - t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B)));
	elseif (F <= 0.0062)
		tmp = Float64(Float64(F / Float64(sin(B) / sqrt(0.5))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
	elseif (F <= 0.0062)
		tmp = (F / (sin(B) / sqrt(0.5))) - t_0;
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 0.0062:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -3.6e10 < F < 0.00619999999999999978

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.2%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.2%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num99.2%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow99.2%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr99.2%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-199.2%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified99.2%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. clear-num99.2%

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
      2. sub-neg99.2%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      3. distribute-neg-frac299.2%

        \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} + \color{blue}{\frac{x}{-\tan B}} \]
    13. Applied egg-rr99.2%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B} + \frac{x}{-\tan B}} \]
    14. Step-by-step derivation
      1. distribute-frac-neg299.2%

        \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} + \color{blue}{\left(-\frac{x}{\tan B}\right)} \]
      2. sub-neg99.2%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}} \]
      3. associate-*r/99.2%

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
      4. *-rgt-identity99.2%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{\sin B \cdot 1}} - \frac{x}{\tan B} \]
      5. times-frac99.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{\sqrt{0.5}}{1}} - \frac{x}{\tan B} \]
      6. /-rgt-identity99.2%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} - \frac{x}{\tan B} \]
      7. associate-/r/99.3%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    15. Simplified99.3%

      \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{\tan B}} \]

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 0.0062)
       (- (/ F (/ (sin B) (sqrt 0.5))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 0.0062) {
		tmp = (F / (sin(B) / sqrt(0.5))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 0.0062d0) then
        tmp = (f / (sin(b) / sqrt(0.5d0))) - t_0
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 0.0062) {
		tmp = (F / (Math.sin(B) / Math.sqrt(0.5))) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 0.0062:
		tmp = (F / (math.sin(B) / math.sqrt(0.5))) - t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 0.0062)
		tmp = Float64(Float64(F / Float64(sin(B) / sqrt(0.5))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 0.0062)
		tmp = (F / (sin(B) / sqrt(0.5))) - t_0;
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 0.0062:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 0.00619999999999999978

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.2%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.2%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num99.2%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow99.2%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr99.2%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-199.2%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified99.2%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Step-by-step derivation
      1. clear-num99.2%

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
      2. sub-neg99.2%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      3. distribute-neg-frac299.2%

        \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} + \color{blue}{\frac{x}{-\tan B}} \]
    13. Applied egg-rr99.2%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B} + \frac{x}{-\tan B}} \]
    14. Step-by-step derivation
      1. distribute-frac-neg299.2%

        \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} + \color{blue}{\left(-\frac{x}{\tan B}\right)} \]
      2. sub-neg99.2%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}} \]
      3. associate-*r/99.2%

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
      4. *-rgt-identity99.2%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{\sin B \cdot 1}} - \frac{x}{\tan B} \]
      5. times-frac99.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{\sqrt{0.5}}{1}} - \frac{x}{\tan B} \]
      6. /-rgt-identity99.2%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} - \frac{x}{\tan B} \]
      7. associate-/r/99.3%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    15. Simplified99.3%

      \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{\tan B}} \]

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 0.0062)
       (- (* F (/ (sqrt 0.5) (sin B))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 0.0062) {
		tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 0.0062d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 0.0062) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 0.0062:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 0.0062)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 0.0062)
		tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 0.0062:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 0.00619999999999999978

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.2%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.2%

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

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 92.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-93}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;\frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 2e-93)
       (- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
       (if (<= F 0.0062)
         (-
          (* (/ 1.0 (/ (sin B) F)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
          (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 2e-93) {
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0062) {
		tmp = ((1.0 / (sin(B) / F)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 2d-93) then
        tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
    else if (f <= 0.0062d0) then
        tmp = ((1.0d0 / (sin(b) / f)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 2e-93) {
		tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0062) {
		tmp = ((1.0 / (Math.sin(B) / F)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 2e-93:
		tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0
	elif F <= 0.0062:
		tmp = ((1.0 / (math.sin(B) / F)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B)
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 2e-93)
		tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0);
	elseif (F <= 0.0062)
		tmp = Float64(Float64(Float64(1.0 / Float64(sin(B) / F)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 2e-93)
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	elseif (F <= 0.0062)
		tmp = ((1.0 / (sin(B) / F)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B);
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-93], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 2 \cdot 10^{-93}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\

\mathbf{elif}\;F \leq 0.0062:\\
\;\;\;\;\frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 1.9999999999999998e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 86.3%

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

    if 1.9999999999999998e-93 < F < 0.00619999999999999978

    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. Step-by-step derivation
      1. clear-num99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B}{F}}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. inv-pow99.4%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\frac{\sin B}{F}\right)}^{-1}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    5. Step-by-step derivation
      1. unpow-199.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    8. Step-by-step derivation
      1. associate-*r/99.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} + \frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. neg-mul-199.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} + \frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    9. Simplified99.4%

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

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

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

Alternative 10: 92.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 2.8e-93)
       (- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
       (if (<= F 0.0062)
         (- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F (sin B))) (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 2.8e-93) {
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0062) {
		tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / sin(B))) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 2.8d-93) then
        tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
    else if (f <= 0.0062d0) then
        tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / sin(b))) - (x / b)
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 2.8e-93) {
		tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0062) {
		tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / Math.sin(B))) - (x / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 2.8e-93:
		tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0
	elif F <= 0.0062:
		tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / math.sin(B))) - (x / B)
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 2.8e-93)
		tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0);
	elseif (F <= 0.0062)
		tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 2.8e-93)
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	elseif (F <= 0.0062)
		tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / sin(B))) - (x / B);
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-93], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\

\mathbf{elif}\;F \leq 0.0062:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 2.79999999999999998e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 86.3%

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

    if 2.79999999999999998e-93 < F < 0.00619999999999999978

    1. Initial program 99.3%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} + \frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. neg-mul-199.4%

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

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

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 86.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-93}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.0046:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1e-5)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F -2.7e-66)
       (* F (/ (sqrt 0.5) (sin B)))
       (if (<= F 2.3e-93)
         (/ (* x (cos B)) (- (sin B)))
         (if (<= F 0.0046)
           (/ F (/ (sin B) (sqrt 0.5)))
           (- (/ 1.0 (sin B)) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1e-5) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= -2.7e-66) {
		tmp = F * (sqrt(0.5) / sin(B));
	} else if (F <= 2.3e-93) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 0.0046) {
		tmp = F / (sin(B) / sqrt(0.5));
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-1d-5)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= (-2.7d-66)) then
        tmp = f * (sqrt(0.5d0) / sin(b))
    else if (f <= 2.3d-93) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 0.0046d0) then
        tmp = f / (sin(b) / sqrt(0.5d0))
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -1e-5) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= -2.7e-66) {
		tmp = F * (Math.sqrt(0.5) / Math.sin(B));
	} else if (F <= 2.3e-93) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 0.0046) {
		tmp = F / (Math.sin(B) / Math.sqrt(0.5));
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1e-5:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= -2.7e-66:
		tmp = F * (math.sqrt(0.5) / math.sin(B))
	elif F <= 2.3e-93:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 0.0046:
		tmp = F / (math.sin(B) / math.sqrt(0.5))
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1e-5)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= -2.7e-66)
		tmp = Float64(F * Float64(sqrt(0.5) / sin(B)));
	elseif (F <= 2.3e-93)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 0.0046)
		tmp = Float64(F / Float64(sin(B) / sqrt(0.5)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1e-5)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= -2.7e-66)
		tmp = F * (sqrt(0.5) / sin(B));
	elseif (F <= 2.3e-93)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 0.0046)
		tmp = F / (sin(B) / sqrt(0.5));
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.7e-66], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-93], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.0046], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq -2.7 \cdot 10^{-66}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-93}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 0.0046:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -1.00000000000000008e-5

    1. Initial program 61.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. Simplified75.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.7%

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

    if -1.00000000000000008e-5 < F < -2.69999999999999996e-66

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 90.6%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    8. Step-by-step derivation
      1. associate-/l*90.6%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    9. Simplified90.6%

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

    if -2.69999999999999996e-66 < F < 2.2999999999999998e-93

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 33.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num32.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow32.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr32.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-132.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified32.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    9. Taylor expanded in x around inf 83.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    10. Step-by-step derivation
      1. mul-1-neg83.4%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    11. Simplified83.4%

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

    if 2.2999999999999998e-93 < F < 0.0045999999999999999

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative96.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num96.6%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow96.6%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr96.6%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-196.6%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified96.6%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in F around inf 77.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    13. Step-by-step derivation
      1. *-rgt-identity77.4%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{\sin B \cdot 1}} \]
      2. times-frac77.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{\sqrt{0.5}}{1}} \]
      3. /-rgt-identity77.5%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]
      4. associate-/r/77.9%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
    14. Simplified77.9%

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

    if 0.0045999999999999999 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification91.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-93}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.0046:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 91.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-84}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;F \cdot \frac{1}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 7e-84)
       (- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
       (if (<= F 0.0062)
         (- (* F (/ 1.0 (/ (sin B) (sqrt 0.5)))) (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 7e-84) {
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0062) {
		tmp = (F * (1.0 / (sin(B) / sqrt(0.5)))) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 7d-84) then
        tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
    else if (f <= 0.0062d0) then
        tmp = (f * (1.0d0 / (sin(b) / sqrt(0.5d0)))) - (x / b)
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 7e-84) {
		tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	} else if (F <= 0.0062) {
		tmp = (F * (1.0 / (Math.sin(B) / Math.sqrt(0.5)))) - (x / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 7e-84:
		tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0
	elif F <= 0.0062:
		tmp = (F * (1.0 / (math.sin(B) / math.sqrt(0.5)))) - (x / B)
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 7e-84)
		tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0);
	elseif (F <= 0.0062)
		tmp = Float64(Float64(F * Float64(1.0 / Float64(sin(B) / sqrt(0.5)))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 7e-84)
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
	elseif (F <= 0.0062)
		tmp = (F * (1.0 / (sin(B) / sqrt(0.5)))) - (x / B);
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-84], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(F * N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 7 \cdot 10^{-84}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\

\mathbf{elif}\;F \leq 0.0062:\\
\;\;\;\;F \cdot \frac{1}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 7.0000000000000002e-84

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 86.4%

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

    if 7.0000000000000002e-84 < F < 0.00619999999999999978

    1. Initial program 99.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.2%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.2%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 96.2%

      \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    9. Step-by-step derivation
      1. clear-num96.5%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow96.5%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Applied egg-rr96.5%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{B} \]
    11. Step-by-step derivation
      1. unpow-196.5%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Simplified96.5%

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

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-84}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;F \cdot \frac{1}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 91.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-81}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.0048:\\ \;\;\;\;F \cdot \frac{1}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 9.6e-81)
       (- (/ (* F (sqrt 0.5)) B) t_0)
       (if (<= F 0.0048)
         (- (* F (/ 1.0 (/ (sin B) (sqrt 0.5)))) (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 9.6e-81) {
		tmp = ((F * sqrt(0.5)) / B) - t_0;
	} else if (F <= 0.0048) {
		tmp = (F * (1.0 / (sin(B) / sqrt(0.5)))) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 9.6d-81) then
        tmp = ((f * sqrt(0.5d0)) / b) - t_0
    else if (f <= 0.0048d0) then
        tmp = (f * (1.0d0 / (sin(b) / sqrt(0.5d0)))) - (x / b)
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 9.6e-81) {
		tmp = ((F * Math.sqrt(0.5)) / B) - t_0;
	} else if (F <= 0.0048) {
		tmp = (F * (1.0 / (Math.sin(B) / Math.sqrt(0.5)))) - (x / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 9.6e-81:
		tmp = ((F * math.sqrt(0.5)) / B) - t_0
	elif F <= 0.0048:
		tmp = (F * (1.0 / (math.sin(B) / math.sqrt(0.5)))) - (x / B)
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 9.6e-81)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_0);
	elseif (F <= 0.0048)
		tmp = Float64(Float64(F * Float64(1.0 / Float64(sin(B) / sqrt(0.5)))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 9.6e-81)
		tmp = ((F * sqrt(0.5)) / B) - t_0;
	elseif (F <= 0.0048)
		tmp = (F * (1.0 / (sin(B) / sqrt(0.5)))) - (x / B);
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.6e-81], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0048], N[(N[(F * N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 9.6 \cdot 10^{-81}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\

\mathbf{elif}\;F \leq 0.0048:\\
\;\;\;\;F \cdot \frac{1}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 9.5999999999999996e-81

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow99.7%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr99.7%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-199.7%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in B around 0 86.5%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{B}} - \frac{x}{\tan B} \]

    if 9.5999999999999996e-81 < F < 0.00479999999999999958

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.1%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.1%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.1%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 96.1%

      \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    9. Step-by-step derivation
      1. clear-num96.4%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow96.4%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Applied egg-rr96.4%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{B} \]
    11. Step-by-step derivation
      1. unpow-196.4%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Simplified96.4%

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

    if 0.00479999999999999958 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-81}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0048:\\ \;\;\;\;F \cdot \frac{1}{\frac{\sin B}{\sqrt{0.5}}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 91.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;F \cdot \left(t\_1 \cdot \sqrt{0.5}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_1 - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))) (t_1 (/ 1.0 (sin B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 2.8e-93)
       (- (/ (* F (sqrt 0.5)) B) t_0)
       (if (<= F 0.0062) (- (* F (* t_1 (sqrt 0.5))) (/ x B)) (- t_1 t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = 1.0 / sin(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 2.8e-93) {
		tmp = ((F * sqrt(0.5)) / B) - t_0;
	} else if (F <= 0.0062) {
		tmp = (F * (t_1 * sqrt(0.5))) - (x / B);
	} else {
		tmp = t_1 - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = 1.0d0 / sin(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 2.8d-93) then
        tmp = ((f * sqrt(0.5d0)) / b) - t_0
    else if (f <= 0.0062d0) then
        tmp = (f * (t_1 * sqrt(0.5d0))) - (x / b)
    else
        tmp = t_1 - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double t_1 = 1.0 / Math.sin(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 2.8e-93) {
		tmp = ((F * Math.sqrt(0.5)) / B) - t_0;
	} else if (F <= 0.0062) {
		tmp = (F * (t_1 * Math.sqrt(0.5))) - (x / B);
	} else {
		tmp = t_1 - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = 1.0 / math.sin(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 2.8e-93:
		tmp = ((F * math.sqrt(0.5)) / B) - t_0
	elif F <= 0.0062:
		tmp = (F * (t_1 * math.sqrt(0.5))) - (x / B)
	else:
		tmp = t_1 - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(1.0 / sin(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 2.8e-93)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_0);
	elseif (F <= 0.0062)
		tmp = Float64(Float64(F * Float64(t_1 * sqrt(0.5))) - Float64(x / B));
	else
		tmp = Float64(t_1 - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = 1.0 / sin(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 2.8e-93)
		tmp = ((F * sqrt(0.5)) / B) - t_0;
	elseif (F <= 0.0062)
		tmp = (F * (t_1 * sqrt(0.5))) - (x / B);
	else
		tmp = t_1 - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-93], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(F * N[(t$95$1 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\

\mathbf{elif}\;F \leq 0.0062:\\
\;\;\;\;F \cdot \left(t\_1 \cdot \sqrt{0.5}\right) - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;t\_1 - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 2.79999999999999998e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow99.8%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr99.8%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified99.8%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in B around 0 86.3%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{B}} - \frac{x}{\tan B} \]

    if 2.79999999999999998e-93 < F < 0.00619999999999999978

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative96.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 96.4%

      \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} - \color{blue}{\frac{x}{B}} \]
    9. Step-by-step derivation
      1. div-inv96.5%

        \[\leadsto F \cdot \color{blue}{\left(\sqrt{0.5} \cdot \frac{1}{\sin B}\right)} - \frac{x}{B} \]
    10. Applied egg-rr96.5%

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

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;F \cdot \left(\frac{1}{\sin B} \cdot \sqrt{0.5}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 64.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.085:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.8 \cdot 10^{-156} \lor \neg \left(F \leq 2.4 \cdot 10^{-93}\right) \land F \leq 0.0057:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.085)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F -3.8e-156) (and (not (<= F 2.4e-93)) (<= F 0.0057)))
     (/ F (/ (sin B) (sqrt 0.5)))
     (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.085) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= -3.8e-156) || (!(F <= 2.4e-93) && (F <= 0.0057))) {
		tmp = F / (sin(B) / sqrt(0.5));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.085d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= (-3.8d-156)) .or. (.not. (f <= 2.4d-93)) .and. (f <= 0.0057d0)) then
        tmp = f / (sin(b) / sqrt(0.5d0))
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.085) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= -3.8e-156) || (!(F <= 2.4e-93) && (F <= 0.0057))) {
		tmp = F / (Math.sin(B) / Math.sqrt(0.5));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.085:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= -3.8e-156) or (not (F <= 2.4e-93) and (F <= 0.0057)):
		tmp = F / (math.sin(B) / math.sqrt(0.5))
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.085)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= -3.8e-156) || (!(F <= 2.4e-93) && (F <= 0.0057)))
		tmp = Float64(F / Float64(sin(B) / sqrt(0.5)));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.085)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= -3.8e-156) || (~((F <= 2.4e-93)) && (F <= 0.0057)))
		tmp = F / (sin(B) / sqrt(0.5));
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.085], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -3.8e-156], And[N[Not[LessEqual[F, 2.4e-93]], $MachinePrecision], LessEqual[F, 0.0057]]], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.085:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -3.8 \cdot 10^{-156} \lor \neg \left(F \leq 2.4 \cdot 10^{-93}\right) \land F \leq 0.0057:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\

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


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

    1. Initial program 61.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. Simplified75.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.7%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 79.5%

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

    if -0.0850000000000000061 < F < -3.80000000000000008e-156 or 2.4000000000000001e-93 < F < 0.0057000000000000002

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 98.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative98.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified98.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 98.0%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num98.2%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow98.2%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr98.2%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-198.2%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified98.2%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in F around inf 72.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    13. Step-by-step derivation
      1. *-rgt-identity72.4%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{\sin B \cdot 1}} \]
      2. times-frac72.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{\sqrt{0.5}}{1}} \]
      3. /-rgt-identity72.4%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]
      4. associate-/r/72.7%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
    14. Simplified72.7%

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

    if -3.80000000000000008e-156 < F < 2.4000000000000001e-93 or 0.0057000000000000002 < F

    1. Initial program 81.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 69.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.085:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.8 \cdot 10^{-156} \lor \neg \left(F \leq 2.4 \cdot 10^{-93}\right) \land F \leq 0.0057:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 64.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.0021:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.9 \cdot 10^{-156} \lor \neg \left(F \leq 1.95 \cdot 10^{-93}\right) \land F \leq 0.0048:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.0021)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F -3.9e-156) (and (not (<= F 1.95e-93)) (<= F 0.0048)))
     (* F (/ (sqrt 0.5) (sin B)))
     (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0021) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= -3.9e-156) || (!(F <= 1.95e-93) && (F <= 0.0048))) {
		tmp = F * (sqrt(0.5) / sin(B));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.0021d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= (-3.9d-156)) .or. (.not. (f <= 1.95d-93)) .and. (f <= 0.0048d0)) then
        tmp = f * (sqrt(0.5d0) / sin(b))
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0021) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= -3.9e-156) || (!(F <= 1.95e-93) && (F <= 0.0048))) {
		tmp = F * (Math.sqrt(0.5) / Math.sin(B));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.0021:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= -3.9e-156) or (not (F <= 1.95e-93) and (F <= 0.0048)):
		tmp = F * (math.sqrt(0.5) / math.sin(B))
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.0021)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= -3.9e-156) || (!(F <= 1.95e-93) && (F <= 0.0048)))
		tmp = Float64(F * Float64(sqrt(0.5) / sin(B)));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.0021)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= -3.9e-156) || (~((F <= 1.95e-93)) && (F <= 0.0048)))
		tmp = F * (sqrt(0.5) / sin(B));
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.0021], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -3.9e-156], And[N[Not[LessEqual[F, 1.95e-93]], $MachinePrecision], LessEqual[F, 0.0048]]], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0021:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -3.9 \cdot 10^{-156} \lor \neg \left(F \leq 1.95 \cdot 10^{-93}\right) \land F \leq 0.0048:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\

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


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

    1. Initial program 61.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. Simplified75.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.7%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 79.5%

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

    if -0.00209999999999999987 < F < -3.9000000000000001e-156 or 1.95000000000000009e-93 < F < 0.00479999999999999958

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 98.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative98.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified98.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 72.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    8. Step-by-step derivation
      1. associate-/l*72.3%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    9. Simplified72.3%

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

    if -3.9000000000000001e-156 < F < 1.95000000000000009e-93 or 0.00479999999999999958 < F

    1. Initial program 81.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 69.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0021:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.9 \cdot 10^{-156} \lor \neg \left(F \leq 1.95 \cdot 10^{-93}\right) \land F \leq 0.0048:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 79.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.35 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-93}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.0052:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -7.2e-5)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F -2.35e-66)
     (* F (/ (sqrt 0.5) (sin B)))
     (if (<= F 3.1e-93)
       (/ (* x (cos B)) (- (sin B)))
       (if (<= F 0.0052)
         (/ F (/ (sin B) (sqrt 0.5)))
         (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.2e-5) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -2.35e-66) {
		tmp = F * (sqrt(0.5) / sin(B));
	} else if (F <= 3.1e-93) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 0.0052) {
		tmp = F / (sin(B) / sqrt(0.5));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-7.2d-5)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-2.35d-66)) then
        tmp = f * (sqrt(0.5d0) / sin(b))
    else if (f <= 3.1d-93) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 0.0052d0) then
        tmp = f / (sin(b) / sqrt(0.5d0))
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.2e-5) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -2.35e-66) {
		tmp = F * (Math.sqrt(0.5) / Math.sin(B));
	} else if (F <= 3.1e-93) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 0.0052) {
		tmp = F / (Math.sin(B) / Math.sqrt(0.5));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -7.2e-5:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -2.35e-66:
		tmp = F * (math.sqrt(0.5) / math.sin(B))
	elif F <= 3.1e-93:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 0.0052:
		tmp = F / (math.sin(B) / math.sqrt(0.5))
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -7.2e-5)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -2.35e-66)
		tmp = Float64(F * Float64(sqrt(0.5) / sin(B)));
	elseif (F <= 3.1e-93)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 0.0052)
		tmp = Float64(F / Float64(sin(B) / sqrt(0.5)));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -7.2e-5)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -2.35e-66)
		tmp = F * (sqrt(0.5) / sin(B));
	elseif (F <= 3.1e-93)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 0.0052)
		tmp = F / (sin(B) / sqrt(0.5));
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -7.2e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.35e-66], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-93], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.0052], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -2.35 \cdot 10^{-66}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\

\mathbf{elif}\;F \leq 3.1 \cdot 10^{-93}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 0.0052:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -7.20000000000000018e-5

    1. Initial program 61.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. Simplified75.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.7%

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

    if -7.20000000000000018e-5 < F < -2.35e-66

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 90.6%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    8. Step-by-step derivation
      1. associate-/l*90.6%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    9. Simplified90.6%

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

    if -2.35e-66 < F < 3.1e-93

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 33.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num32.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow32.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr32.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-132.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified32.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    9. Taylor expanded in x around inf 83.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    10. Step-by-step derivation
      1. mul-1-neg83.4%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    11. Simplified83.4%

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

    if 3.1e-93 < F < 0.0051999999999999998

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative96.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num96.6%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow96.6%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr96.6%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-196.6%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified96.6%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in F around inf 77.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    13. Step-by-step derivation
      1. *-rgt-identity77.4%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{\sin B \cdot 1}} \]
      2. times-frac77.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{\sqrt{0.5}}{1}} \]
      3. /-rgt-identity77.5%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]
      4. associate-/r/77.9%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
    14. Simplified77.9%

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

    if 0.0051999999999999998 < F

    1. Initial program 59.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 43.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.35 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-93}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.0052:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 73.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.0017:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-93}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.0047:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.0017)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -2.4e-66)
     (* F (/ (sqrt 0.5) (sin B)))
     (if (<= F 3.2e-93)
       (/ (* x (cos B)) (- (sin B)))
       (if (<= F 0.0047)
         (/ F (/ (sin B) (sqrt 0.5)))
         (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0017) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.4e-66) {
		tmp = F * (sqrt(0.5) / sin(B));
	} else if (F <= 3.2e-93) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 0.0047) {
		tmp = F / (sin(B) / sqrt(0.5));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.0017d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.4d-66)) then
        tmp = f * (sqrt(0.5d0) / sin(b))
    else if (f <= 3.2d-93) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 0.0047d0) then
        tmp = f / (sin(b) / sqrt(0.5d0))
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0017) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.4e-66) {
		tmp = F * (Math.sqrt(0.5) / Math.sin(B));
	} else if (F <= 3.2e-93) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 0.0047) {
		tmp = F / (Math.sin(B) / Math.sqrt(0.5));
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.0017:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.4e-66:
		tmp = F * (math.sqrt(0.5) / math.sin(B))
	elif F <= 3.2e-93:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 0.0047:
		tmp = F / (math.sin(B) / math.sqrt(0.5))
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.0017)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.4e-66)
		tmp = Float64(F * Float64(sqrt(0.5) / sin(B)));
	elseif (F <= 3.2e-93)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 0.0047)
		tmp = Float64(F / Float64(sin(B) / sqrt(0.5)));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.0017)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.4e-66)
		tmp = F * (sqrt(0.5) / sin(B));
	elseif (F <= 3.2e-93)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 0.0047)
		tmp = F / (sin(B) / sqrt(0.5));
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.0017], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.4e-66], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.2e-93], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.0047], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0017:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.4 \cdot 10^{-66}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\

\mathbf{elif}\;F \leq 3.2 \cdot 10^{-93}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 0.0047:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\

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


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

    1. Initial program 61.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. Simplified75.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.7%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 79.5%

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

    if -0.00169999999999999991 < F < -2.40000000000000026e-66

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 90.6%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    8. Step-by-step derivation
      1. associate-/l*90.6%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    9. Simplified90.6%

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

    if -2.40000000000000026e-66 < F < 3.1999999999999999e-93

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 33.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num32.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow32.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr32.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-132.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified32.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    9. Taylor expanded in x around inf 83.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    10. Step-by-step derivation
      1. mul-1-neg83.4%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
    11. Simplified83.4%

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

    if 3.1999999999999999e-93 < F < 0.00470000000000000018

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative96.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num96.6%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow96.6%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr96.6%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-196.6%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified96.6%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in F around inf 77.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    13. Step-by-step derivation
      1. *-rgt-identity77.4%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{\sin B \cdot 1}} \]
      2. times-frac77.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{\sqrt{0.5}}{1}} \]
      3. /-rgt-identity77.5%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]
      4. associate-/r/77.9%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
    14. Simplified77.9%

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

    if 0.00470000000000000018 < F

    1. Initial program 59.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 43.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0017:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.4 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-93}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.0047:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 91.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-77}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.006:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 2.7e-77)
       (- (/ (* F (sqrt 0.5)) B) t_0)
       (if (<= F 0.006)
         (- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 2.7e-77) {
		tmp = ((F * sqrt(0.5)) / B) - t_0;
	} else if (F <= 0.006) {
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 2.7d-77) then
        tmp = ((f * sqrt(0.5d0)) / b) - t_0
    else if (f <= 0.006d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 2.7e-77) {
		tmp = ((F * Math.sqrt(0.5)) / B) - t_0;
	} else if (F <= 0.006) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 2.7e-77:
		tmp = ((F * math.sqrt(0.5)) / B) - t_0
	elif F <= 0.006:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B)
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 2.7e-77)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_0);
	elseif (F <= 0.006)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 2.7e-77)
		tmp = ((F * sqrt(0.5)) / B) - t_0;
	elseif (F <= 0.006)
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-77], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.006], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-77}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 2.7e-77

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow99.7%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr99.7%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-199.7%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in B around 0 86.5%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{B}} - \frac{x}{\tan B} \]

    if 2.7e-77 < F < 0.0060000000000000001

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.1%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.1%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.1%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 96.1%

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

    if 0.0060000000000000001 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-77}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.006:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 91.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.0058:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (+ (/ -1.0 (sin B)) (/ -1.0 (/ (tan B) x)))
     (if (<= F 2.8e-93)
       (- (* F (/ (sqrt 0.5) B)) t_0)
       (if (<= F 0.0058)
         (- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	} else if (F <= 2.8e-93) {
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	} else if (F <= 0.0058) {
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + ((-1.0d0) / (tan(b) / x))
    else if (f <= 2.8d-93) then
        tmp = (f * (sqrt(0.5d0) / b)) - t_0
    else if (f <= 0.0058d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (-1.0 / (Math.tan(B) / x));
	} else if (F <= 2.8e-93) {
		tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
	} else if (F <= 0.0058) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) + (-1.0 / (math.tan(B) / x))
	elif F <= 2.8e-93:
		tmp = (F * (math.sqrt(0.5) / B)) - t_0
	elif F <= 0.0058:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B)
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(-1.0 / Float64(tan(B) / x)));
	elseif (F <= 2.8e-93)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0);
	elseif (F <= 0.0058)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) + (-1.0 / (tan(B) / x));
	elseif (F <= 2.8e-93)
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	elseif (F <= 0.0058)
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-93], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0058], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

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

    if -3.6e10 < F < 2.79999999999999998e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 86.3%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{B}} - \frac{x}{\tan B} \]

    if 2.79999999999999998e-93 < F < 0.0058

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative96.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 96.4%

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

    if 0.0058 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0058:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 91.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-93}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.0062:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 2.1e-93)
       (- (* F (/ (sqrt 0.5) B)) t_0)
       (if (<= F 0.0062)
         (- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 2.1e-93) {
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	} else if (F <= 0.0062) {
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 2.1d-93) then
        tmp = (f * (sqrt(0.5d0) / b)) - t_0
    else if (f <= 0.0062d0) then
        tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 2.1e-93) {
		tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
	} else if (F <= 0.0062) {
		tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 2.1e-93:
		tmp = (F * (math.sqrt(0.5) / B)) - t_0
	elif F <= 0.0062:
		tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B)
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 2.1e-93)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0);
	elseif (F <= 0.0062)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 2.1e-93)
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	elseif (F <= 0.0062)
		tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.1e-93], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0062], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 2.1 \cdot 10^{-93}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -3.6e10 < F < 2.1000000000000001e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 86.3%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{B}} - \frac{x}{\tan B} \]

    if 2.1000000000000001e-93 < F < 0.00619999999999999978

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative96.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified96.4%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 96.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 96.4%

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

    if 0.00619999999999999978 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 22: 91.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-42}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\ \mathbf{elif}\;F \leq 0.0057:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -36000000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 2.4e-42)
       (- (* F (/ (sqrt 0.5) B)) t_0)
       (if (<= F 0.0057)
         (/ F (/ (sin B) (sqrt 0.5)))
         (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 2.4e-42) {
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	} else if (F <= 0.0057) {
		tmp = F / (sin(B) / sqrt(0.5));
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    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 / tan(b)
    if (f <= (-36000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 2.4d-42) then
        tmp = (f * (sqrt(0.5d0) / b)) - t_0
    else if (f <= 0.0057d0) then
        tmp = f / (sin(b) / sqrt(0.5d0))
    else
        tmp = (1.0d0 / sin(b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -36000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 2.4e-42) {
		tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
	} else if (F <= 0.0057) {
		tmp = F / (Math.sin(B) / Math.sqrt(0.5));
	} else {
		tmp = (1.0 / Math.sin(B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -36000000000.0:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 2.4e-42:
		tmp = (F * (math.sqrt(0.5) / B)) - t_0
	elif F <= 0.0057:
		tmp = F / (math.sin(B) / math.sqrt(0.5))
	else:
		tmp = (1.0 / math.sin(B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 2.4e-42)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0);
	elseif (F <= 0.0057)
		tmp = Float64(F / Float64(sin(B) / sqrt(0.5)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 2.4e-42)
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	elseif (F <= 0.0057)
		tmp = F / (sin(B) / sqrt(0.5));
	else
		tmp = (1.0 / sin(B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.4e-42], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0057], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-42}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

\mathbf{elif}\;F \leq 0.0057:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.6e10

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

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

    if -3.6e10 < F < 2.40000000000000003e-42

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 85.1%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{B}} - \frac{x}{\tan B} \]

    if 2.40000000000000003e-42 < F < 0.0057000000000000002

    1. Initial program 99.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. Simplified98.8%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 92.9%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative92.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified92.9%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in x around 0 92.9%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{0.5}}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. clear-num93.3%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. inv-pow93.3%

        \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    9. Applied egg-rr93.3%

      \[\leadsto F \cdot \color{blue}{{\left(\frac{\sin B}{\sqrt{0.5}}\right)}^{-1}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. unpow-193.3%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    11. Simplified93.3%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    12. Taylor expanded in F around inf 92.8%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    13. Step-by-step derivation
      1. *-rgt-identity92.8%

        \[\leadsto \frac{F \cdot \sqrt{0.5}}{\color{blue}{\sin B \cdot 1}} \]
      2. times-frac93.0%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \frac{\sqrt{0.5}}{1}} \]
      3. /-rgt-identity93.0%

        \[\leadsto \frac{F}{\sin B} \cdot \color{blue}{\sqrt{0.5}} \]
      4. associate-/r/93.6%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} \]
    14. Simplified93.6%

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

    if 0.0057000000000000002 < F

    1. Initial program 59.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. Simplified70.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 99.8%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 23: 63.2% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1500000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1500000000000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 2.2e-93)
     (- (/ -1.0 B) (/ x (tan B)))
     (if (<= F 2.3e-9)
       (- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
       (- (/ 1.0 B) (* x (/ 1.0 (tan B))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1500000000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 2.2e-93) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 2.3e-9) {
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1500000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 2.2d-93) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 2.3d-9) then
        tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1500000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 2.2e-93) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 2.3e-9) {
		tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1500000000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 2.2e-93:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 2.3e-9:
		tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1500000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 2.2e-93)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 2.3e-9)
		tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1500000000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 2.2e-93)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 2.3e-9)
		tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1500000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.2e-93], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-9], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1500000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.2 \cdot 10^{-93}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.5e12

    1. Initial program 58.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. Simplified74.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 79.7%

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

    if -1.5e12 < F < 2.19999999999999996e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 33.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 50.1%

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

    if 2.19999999999999996e-93 < F < 2.2999999999999999e-9

    1. Initial program 99.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 67.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]
    8. Taylor expanded in F around 0 67.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]

    if 2.2999999999999999e-9 < F

    1. Initial program 60.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 42.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1500000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 63.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1460000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1460000000000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 2.4e-93)
     (- (/ -1.0 B) (/ x (tan B)))
     (if (<= F 3.9e-10)
       (- (* (sqrt 0.5) (/ F B)) (/ x B))
       (- (/ 1.0 B) (* x (/ 1.0 (tan B))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1460000000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 2.4e-93) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 3.9e-10) {
		tmp = (sqrt(0.5) * (F / B)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1460000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 2.4d-93) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 3.9d-10) then
        tmp = (sqrt(0.5d0) * (f / b)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1460000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 2.4e-93) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 3.9e-10) {
		tmp = (Math.sqrt(0.5) * (F / B)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1460000000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 2.4e-93:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 3.9e-10:
		tmp = (math.sqrt(0.5) * (F / B)) - (x / B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1460000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 2.4e-93)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 3.9e-10)
		tmp = Float64(Float64(sqrt(0.5) * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1460000000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 2.4e-93)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 3.9e-10)
		tmp = (sqrt(0.5) * (F / B)) - (x / B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1460000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e-93], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e-10], N[(N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1460000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 3.9 \cdot 10^{-10}:\\
\;\;\;\;\sqrt{0.5} \cdot \frac{F}{B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.46e12

    1. Initial program 58.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. Simplified74.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 79.7%

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

    if -1.46e12 < F < 2.4000000000000001e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 33.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 50.1%

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

    if 2.4000000000000001e-93 < F < 3.9e-10

    1. Initial program 99.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 67.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]
    8. Taylor expanded in F around 0 67.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    9. Taylor expanded in x around 0 67.6%

      \[\leadsto -1 \cdot \frac{x}{B} + \frac{F}{B} \cdot \color{blue}{\sqrt{0.5}} \]

    if 3.9e-10 < F

    1. Initial program 60.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 42.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1460000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{-10}:\\ \;\;\;\;\sqrt{0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 63.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -29500000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -29500000000000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 2.8e-93)
     (- (/ -1.0 B) (/ x (tan B)))
     (if (<= F 2.1e-9)
       (/ (- (* F (sqrt 0.5)) x) B)
       (- (/ 1.0 B) (* x (/ 1.0 (tan B))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -29500000000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 2.8e-93) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= 2.1e-9) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-29500000000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 2.8d-93) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= 2.1d-9) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -29500000000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 2.8e-93) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= 2.1e-9) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -29500000000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 2.8e-93:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= 2.1e-9:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -29500000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 2.8e-93)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= 2.1e-9)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -29500000000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 2.8e-93)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= 2.1e-9)
		tmp = ((F * sqrt(0.5)) - x) / B;
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -29500000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-93], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e-9], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -29500000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 2.1 \cdot 10^{-9}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.95e13

    1. Initial program 58.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. Simplified74.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 79.7%

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

    if -2.95e13 < F < 2.79999999999999998e-93

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 33.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 50.1%

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

    if 2.79999999999999998e-93 < F < 2.10000000000000019e-9

    1. Initial program 99.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 99.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}{\sin B} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. *-commutative99.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.0%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 67.4%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]
    8. Taylor expanded in x around 0 67.4%

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

    if 2.10000000000000019e-9 < F

    1. Initial program 60.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 42.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -29500000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 56.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-129} \lor \neg \left(x \leq 1.6 \cdot 10^{-116}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -2.4e-129) (not (<= x 1.6e-116)))
   (- (/ -1.0 B) (/ x (tan B)))
   (/ -1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.4e-129) || !(x <= 1.6e-116)) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else {
		tmp = -1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-2.4d-129)) .or. (.not. (x <= 1.6d-116))) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else
        tmp = (-1.0d0) / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.4e-129) || !(x <= 1.6e-116)) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = -1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -2.4e-129) or not (x <= 1.6e-116):
		tmp = (-1.0 / B) - (x / math.tan(B))
	else:
		tmp = -1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -2.4e-129) || !(x <= 1.6e-116))
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(-1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -2.4e-129) || ~((x <= 1.6e-116)))
		tmp = (-1.0 / B) - (x / tan(B));
	else
		tmp = -1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.4e-129], N[Not[LessEqual[x, 1.6e-116]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-129} \lor \neg \left(x \leq 1.6 \cdot 10^{-116}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.39999999999999989e-129 or 1.60000000000000005e-116 < x

    1. Initial program 82.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. Simplified91.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 62.1%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 67.8%

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

    if -2.39999999999999989e-129 < x < 1.60000000000000005e-116

    1. Initial program 71.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. Simplified75.1%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 30.5%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num30.5%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow30.5%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr30.5%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-130.5%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified30.5%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    9. Taylor expanded in x around 0 30.5%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-129} \lor \neg \left(x \leq 1.6 \cdot 10^{-116}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 42.1% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 6 \cdot 10^{-45}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= B 6e-45) (/ (- (* F (sqrt 0.5)) x) B) (- (/ -1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (B <= 6e-45) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else {
		tmp = (-1.0 / B) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (b <= 6d-45) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else
        tmp = ((-1.0d0) / b) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (B <= 6e-45) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if B <= 6e-45:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	else:
		tmp = (-1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (B <= 6e-45)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	else
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (B <= 6e-45)
		tmp = ((F * sqrt(0.5)) - x) / B;
	else
		tmp = (-1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[B, 6e-45], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq 6 \cdot 10^{-45}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 6.00000000000000022e-45

    1. Initial program 77.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. Simplified85.8%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around 0 59.1%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified59.1%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + x \cdot 2}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 38.5%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]
    8. Taylor expanded in x around 0 39.9%

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

    if 6.00000000000000022e-45 < B

    1. Initial program 83.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. Simplified85.1%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 47.1%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 48.6%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 28: 54.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.72 \cdot 10^{+14}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.72e+14)
   (- (/ -1.0 (sin B)) (/ x B))
   (- (/ -1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.72e+14) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else {
		tmp = (-1.0 / B) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.72d+14)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else
        tmp = ((-1.0d0) / b) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.72e+14) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.72e+14:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	else:
		tmp = (-1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.72e+14)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.72e+14)
		tmp = (-1.0 / sin(B)) - (x / B);
	else
		tmp = (-1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.72e+14], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.72 \cdot 10^{+14}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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


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

    1. Initial program 58.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. Simplified74.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 79.7%

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

    if -2.72e14 < F

    1. Initial program 85.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. Simplified89.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 34.6%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 44.6%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 29: 37.4% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -36000000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -36000000000.0) (/ -1.0 (sin B)) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -36000000000.0) {
		tmp = -1.0 / sin(B);
	} else {
		tmp = -x / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-36000000000.0d0)) then
        tmp = (-1.0d0) / sin(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 <= -36000000000.0) {
		tmp = -1.0 / Math.sin(B);
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -36000000000.0:
		tmp = -1.0 / math.sin(B)
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -36000000000.0)
		tmp = Float64(-1.0 / sin(B));
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -36000000000.0)
		tmp = -1.0 / sin(B);
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -36000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -36000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    8. Simplified99.8%

      \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
    9. Taylor expanded in x around 0 64.2%

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

    if -3.6e10 < F

    1. Initial program 85.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. Simplified89.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 34.2%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 18.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg18.8%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac218.8%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
      3. +-commutative18.8%

        \[\leadsto \frac{\color{blue}{x + 1}}{-B} \]
    7. Simplified18.8%

      \[\leadsto \color{blue}{\frac{x + 1}{-B}} \]
    8. Taylor expanded in x around inf 29.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. associate-*r/29.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-129.6%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified29.6%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 30: 36.6% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-87}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.3e-87) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-87) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.3d-87)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = -x / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.3e-87) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.3e-87:
		tmp = (-1.0 - x) / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.3e-87)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.3e-87)
		tmp = (-1.0 - x) / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-87], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-87}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -2.3000000000000001e-87

    1. Initial program 68.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. Simplified80.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 85.7%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 40.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg40.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac240.3%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
      3. +-commutative40.3%

        \[\leadsto \frac{\color{blue}{x + 1}}{-B} \]
    7. Simplified40.3%

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

    if -2.3000000000000001e-87 < F

    1. Initial program 84.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified88.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 33.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 18.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg18.6%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac218.6%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
      3. +-commutative18.6%

        \[\leadsto \frac{\color{blue}{x + 1}}{-B} \]
    7. Simplified18.6%

      \[\leadsto \color{blue}{\frac{x + 1}{-B}} \]
    8. Taylor expanded in x around inf 30.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. associate-*r/30.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-130.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified30.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{-87}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 31: 30.1% accurate, 35.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -95000000000:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -95000000000.0) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -95000000000.0) {
		tmp = -1.0 / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-95000000000.0d0)) then
        tmp = (-1.0d0) / 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 <= -95000000000.0) {
		tmp = -1.0 / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -95000000000.0:
		tmp = -1.0 / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -95000000000.0)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -95000000000.0)
		tmp = -1.0 / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -95000000000.0], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -95000000000:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


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

    1. Initial program 59.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 99.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 46.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg46.0%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac246.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
      3. +-commutative46.0%

        \[\leadsto \frac{\color{blue}{x + 1}}{-B} \]
    7. Simplified46.0%

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

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

    if -9.5e10 < F

    1. Initial program 85.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. Simplified89.5%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around -inf 34.2%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 18.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg18.8%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac218.8%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
      3. +-commutative18.8%

        \[\leadsto \frac{\color{blue}{x + 1}}{-B} \]
    7. Simplified18.8%

      \[\leadsto \color{blue}{\frac{x + 1}{-B}} \]
    8. Taylor expanded in x around inf 29.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. associate-*r/29.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-129.6%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified29.6%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 32: 10.6% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 78.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. Simplified85.6%

    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
  3. Add Preprocessing
  4. Taylor expanded in F around -inf 50.9%

    \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
  5. Taylor expanded in B around 0 25.7%

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  6. Step-by-step derivation
    1. mul-1-neg25.7%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    2. distribute-neg-frac225.7%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    3. +-commutative25.7%

      \[\leadsto \frac{\color{blue}{x + 1}}{-B} \]
  7. Simplified25.7%

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  9. Add Preprocessing

Reproduce

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