VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.8% → 99.6%
Time: 29.7s
Alternatives: 23
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 23 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.8% 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.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.12 \cdot 10^{+69}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 6.8:\\ \;\;\;\;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 -1.12e+69)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 6.8)
       (- (* 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 <= -1.12e+69) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 6.8) {
		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 <= -1.12e+69)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 6.8)
		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, -1.12e+69], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.8], 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 -1.12 \cdot 10^{+69}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 6.8:\\
\;\;\;\;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 < -1.12e69

    1. Initial program 56.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. Step-by-step derivation
      1. distribute-lft-neg-in56.8%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.8%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 81.9%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef81.9%

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

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

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

    if -1.12e69 < F < 6.79999999999999982

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.6%

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

    if 6.79999999999999982 < F

    1. Initial program 56.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. Step-by-step derivation
      1. distribute-lft-neg-in56.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.1%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 68.0%

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{1}{\sin B}\right)} - \frac{x}{\tan B} \]
    7. 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 -1.12 \cdot 10^{+69}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.8:\\ \;\;\;\;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} \]

Alternative 2: 99.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 6.8:\\
\;\;\;\;F \cdot \frac{t_0}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t_1\\

\mathbf{else}:\\
\;\;\;\;t_0 - t_1\\


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

    1. Initial program 46.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. Step-by-step derivation
      1. distribute-lft-neg-in46.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv46.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified71.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}} \]
    4. Taylor expanded in x around 0 71.2%

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

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

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

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

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

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

    if -1.00000000000000005e149 < F < 6.79999999999999982

    1. Initial program 96.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. Step-by-step derivation
      1. distribute-lft-neg-in96.4%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv96.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. 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}} \]
    4. Taylor expanded in x around 0 99.6%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef99.6%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/99.7%

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

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

    if 6.79999999999999982 < F

    1. Initial program 56.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. Step-by-step derivation
      1. distribute-lft-neg-in56.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.1%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 68.0%

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 6.8:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - 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 -1.5e+36)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 6.8)
       (- (/ (/ F (sin B)) (sqrt (fma F F 2.0))) 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 <= -1.5e+36) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 6.8) {
		tmp = ((F / sin(B)) / sqrt(fma(F, F, 2.0))) - 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 <= -1.5e+36)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 6.8)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(F, F, 2.0))) - 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, -1.5e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.8], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(F * F + 2.0), $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 -1.5 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 6.8:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t_0\\

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


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

    1. Initial program 60.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. Step-by-step derivation
      1. distribute-lft-neg-in60.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv60.1%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified83.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}} \]
    4. Taylor expanded in x around 0 83.3%

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

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

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

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

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

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

    if -1.5e36 < F < 6.79999999999999982

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. 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}} \]
    4. Taylor expanded in x around 0 99.6%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef99.6%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/99.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    13. Step-by-step derivation
      1. expm1-log1p-u81.5%

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

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{\frac{1}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. associate-/l/63.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}}\right)} - 1\right) - \frac{x}{\tan B} \]
    14. Applied egg-rr63.9%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}\right)} - 1\right)} - \frac{x}{\tan B} \]
    15. Step-by-step derivation
      1. expm1-def81.6%

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

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

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

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

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

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

    if 6.79999999999999982 < F

    1. Initial program 56.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. Step-by-step derivation
      1. distribute-lft-neg-in56.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.1%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 68.0%

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

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

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

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

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

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

Alternative 4: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 6.8:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan 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 -1e+17)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 6.8)
       (+
        (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
        (* x (/ -1.0 (tan 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 <= -1e+17) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 6.8) {
		tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(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 <= (-1d+17)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 6.8d0) then
        tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(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 <= -1e+17) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 6.8) {
		tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(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 <= -1e+17:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 6.8:
		tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(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 <= -1e+17)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 6.8)
		tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(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 <= -1e+17)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 6.8)
		tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(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, -1e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.8], N[(N[(N[(F / N[Sin[B], $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 * N[(-1.0 / N[Tan[B], $MachinePrecision]), $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^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

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

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


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

    1. Initial program 64.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in64.7%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv64.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified85.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}} \]
    4. Taylor expanded in x around 0 85.2%

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

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

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

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

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

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

    if -1e17 < F < 6.79999999999999982

    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)} \]

    if 6.79999999999999982 < F

    1. Initial program 56.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. Step-by-step derivation
      1. distribute-lft-neg-in56.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.1%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 68.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.8:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 5: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 6.8:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-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+17)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 6.8)
       (+
        (/ -1.0 (/ (tan B) x))
        (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -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+17) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 6.8) {
		tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -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+17)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 6.8d0) then
        tmp = ((-1.0d0) / (tan(b) / x)) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-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+17) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 6.8) {
		tmp = (-1.0 / (Math.tan(B) / x)) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -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+17:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 6.8:
		tmp = (-1.0 / (math.tan(B) / x)) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -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+17)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 6.8)
		tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -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+17)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 6.8)
		tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -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+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.8], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $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] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 64.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in64.7%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv64.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified85.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}} \]
    4. Taylor expanded in x around 0 85.2%

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

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

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

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

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

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

    if -1e17 < F < 6.79999999999999982

    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. 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. clear-num99.6%

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

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

    if 6.79999999999999982 < F

    1. Initial program 56.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. Step-by-step derivation
      1. distribute-lft-neg-in56.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.1%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 68.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.8:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \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} \]

Alternative 6: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -0.92:\\ \;\;\;\;F \cdot \frac{t_1}{\frac{-1}{F} - F} - t_0\\ \mathbf{elif}\;F \leq 0.9:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}} - t_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{t_1}{F + \frac{1}{F}} - 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 -0.92)
     (- (* F (/ t_1 (- (/ -1.0 F) F))) t_0)
     (if (<= F 0.9)
       (- (/ (sqrt 0.5) (/ (sin B) F)) t_0)
       (- (* F (/ t_1 (+ F (/ 1.0 F)))) 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 <= -0.92) {
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0;
	} else if (F <= 0.9) {
		tmp = (sqrt(0.5) / (sin(B) / F)) - t_0;
	} else {
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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 <= (-0.92d0)) then
        tmp = (f * (t_1 / (((-1.0d0) / f) - f))) - t_0
    else if (f <= 0.9d0) then
        tmp = (sqrt(0.5d0) / (sin(b) / f)) - t_0
    else
        tmp = (f * (t_1 / (f + (1.0d0 / f)))) - 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 <= -0.92) {
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0;
	} else if (F <= 0.9) {
		tmp = (Math.sqrt(0.5) / (Math.sin(B) / F)) - t_0;
	} else {
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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 <= -0.92:
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0
	elif F <= 0.9:
		tmp = (math.sqrt(0.5) / (math.sin(B) / F)) - t_0
	else:
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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 <= -0.92)
		tmp = Float64(Float64(F * Float64(t_1 / Float64(Float64(-1.0 / F) - F))) - t_0);
	elseif (F <= 0.9)
		tmp = Float64(Float64(sqrt(0.5) / Float64(sin(B) / F)) - t_0);
	else
		tmp = Float64(Float64(F * Float64(t_1 / Float64(F + Float64(1.0 / F)))) - 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 <= -0.92)
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0;
	elseif (F <= 0.9)
		tmp = (sqrt(0.5) / (sin(B) / F)) - t_0;
	else
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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, -0.92], N[(N[(F * N[(t$95$1 / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.9], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(t$95$1 / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 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 -0.92:\\
\;\;\;\;F \cdot \frac{t_1}{\frac{-1}{F} - F} - t_0\\

\mathbf{elif}\;F \leq 0.9:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}} - t_0\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{t_1}{F + \frac{1}{F}} - t_0\\


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

    1. Initial program 65.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. Step-by-step derivation
      1. distribute-lft-neg-in65.8%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv65.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified85.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}} \]
    4. Taylor expanded in x around 0 85.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/85.8%

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

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

      \[\leadsto F \cdot \frac{\frac{1}{\sin B}}{\color{blue}{-1 \cdot F - \frac{1}{F}}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. mul-1-neg99.4%

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

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

    if -0.92000000000000004 < F < 0.900000000000000022

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. 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}} \]
    4. Taylor expanded in x around 0 99.6%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef99.6%

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

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

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

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

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

    if 0.900000000000000022 < F

    1. Initial program 56.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in56.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified68.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}} \]
    4. Taylor expanded in x around 0 68.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/68.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.92:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{\frac{-1}{F} - F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.9:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 7: 90.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{1}{\sin B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.8 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1}{\sin B} - t_2\\

\mathbf{elif}\;F \leq -1.7 \cdot 10^{-136}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.52 \cdot 10^{-198}:\\
\;\;\;\;F \cdot \frac{t_1}{F + \frac{1}{F}} - t_2\\

\mathbf{elif}\;F \leq 6.7:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1 - t_2\\


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

    1. Initial program 64.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in64.7%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv64.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified85.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}} \]
    4. Taylor expanded in x around 0 85.2%

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

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

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

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

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

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

    if -3.8e16 < F < -1.7e-136 or 1.5199999999999999e-198 < F < 6.70000000000000018

    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. Taylor expanded in B around 0 76.8%

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

    if -1.7e-136 < F < 1.5199999999999999e-198

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified99.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}} \]
    4. Taylor expanded in x around 0 99.8%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef99.8%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/99.7%

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

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

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

    if 6.70000000000000018 < F

    1. Initial program 56.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. Step-by-step derivation
      1. distribute-lft-neg-in56.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv56.1%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 68.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{+16}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.7 \cdot 10^{-136}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.52 \cdot 10^{-198}:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.7:\\ \;\;\;\;\frac{F}{\sin B} \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} \]

Alternative 8: 90.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.0028:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-141} \lor \neg \left(F \leq 3.1 \cdot 10^{-196}\right) \land F \leq 0.06:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -0.0028)
     (- (/ -1.0 (sin B)) t_0)
     (if (or (<= F -1.6e-141) (and (not (<= F 3.1e-196)) (<= F 0.06)))
       (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
       (- (* F (/ (/ 1.0 (sin B)) (+ F (/ 1.0 F)))) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -0.0028) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if ((F <= -1.6e-141) || (!(F <= 3.1e-196) && (F <= 0.06))) {
		tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else {
		tmp = (F * ((1.0 / sin(B)) / (F + (1.0 / F)))) - 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 <= (-0.0028d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if ((f <= (-1.6d-141)) .or. (.not. (f <= 3.1d-196)) .and. (f <= 0.06d0)) then
        tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
    else
        tmp = (f * ((1.0d0 / sin(b)) / (f + (1.0d0 / f)))) - 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 <= -0.0028) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if ((F <= -1.6e-141) || (!(F <= 3.1e-196) && (F <= 0.06))) {
		tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else {
		tmp = (F * ((1.0 / Math.sin(B)) / (F + (1.0 / F)))) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -0.0028:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif (F <= -1.6e-141) or (not (F <= 3.1e-196) and (F <= 0.06)):
		tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B)
	else:
		tmp = (F * ((1.0 / math.sin(B)) / (F + (1.0 / F)))) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -0.0028)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif ((F <= -1.6e-141) || (!(F <= 3.1e-196) && (F <= 0.06)))
		tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B));
	else
		tmp = Float64(Float64(F * Float64(Float64(1.0 / sin(B)) / Float64(F + Float64(1.0 / F)))) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -0.0028)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif ((F <= -1.6e-141) || (~((F <= 3.1e-196)) && (F <= 0.06)))
		tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	else
		tmp = (F * ((1.0 / sin(B)) / (F + (1.0 / F)))) - 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, -0.0028], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, -1.6e-141], And[N[Not[LessEqual[F, 3.1e-196]], $MachinePrecision], LessEqual[F, 0.06]]], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $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[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.6 \cdot 10^{-141} \lor \neg \left(F \leq 3.1 \cdot 10^{-196}\right) \land F \leq 0.06:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - t_0\\


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

    1. Initial program 65.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. Step-by-step derivation
      1. distribute-lft-neg-in65.8%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv65.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified85.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}} \]
    4. Taylor expanded in x around 0 85.7%

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

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

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

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

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

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

    if -0.00279999999999999997 < F < -1.6000000000000001e-141 or 3.09999999999999993e-196 < F < 0.059999999999999998

    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. Taylor expanded in F around 0 98.4%

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

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

    if -1.6000000000000001e-141 < F < 3.09999999999999993e-196 or 0.059999999999999998 < F

    1. Initial program 75.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. Step-by-step derivation
      1. distribute-lft-neg-in75.0%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv75.0%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified81.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}} \]
    4. Taylor expanded in x around 0 81.8%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef81.8%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/81.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0028:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-141} \lor \neg \left(F \leq 3.1 \cdot 10^{-196}\right) \land F \leq 0.06:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 9: 90.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{1}{\sin B}\\ \mathbf{if}\;F \leq -0.32:\\ \;\;\;\;F \cdot \frac{t_1}{\frac{-1}{F} - F} - t_0\\ \mathbf{elif}\;F \leq -1.3 \cdot 10^{-142} \lor \neg \left(F \leq 4.6 \cdot 10^{-193}\right) \land F \leq 0.114:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{t_1}{F + \frac{1}{F}} - 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 -0.32)
     (- (* F (/ t_1 (- (/ -1.0 F) F))) t_0)
     (if (or (<= F -1.3e-142) (and (not (<= F 4.6e-193)) (<= F 0.114)))
       (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
       (- (* F (/ t_1 (+ F (/ 1.0 F)))) 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 <= -0.32) {
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0;
	} else if ((F <= -1.3e-142) || (!(F <= 4.6e-193) && (F <= 0.114))) {
		tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else {
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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 <= (-0.32d0)) then
        tmp = (f * (t_1 / (((-1.0d0) / f) - f))) - t_0
    else if ((f <= (-1.3d-142)) .or. (.not. (f <= 4.6d-193)) .and. (f <= 0.114d0)) then
        tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
    else
        tmp = (f * (t_1 / (f + (1.0d0 / f)))) - 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 <= -0.32) {
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0;
	} else if ((F <= -1.3e-142) || (!(F <= 4.6e-193) && (F <= 0.114))) {
		tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	} else {
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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 <= -0.32:
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0
	elif (F <= -1.3e-142) or (not (F <= 4.6e-193) and (F <= 0.114)):
		tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B)
	else:
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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 <= -0.32)
		tmp = Float64(Float64(F * Float64(t_1 / Float64(Float64(-1.0 / F) - F))) - t_0);
	elseif ((F <= -1.3e-142) || (!(F <= 4.6e-193) && (F <= 0.114)))
		tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B));
	else
		tmp = Float64(Float64(F * Float64(t_1 / Float64(F + Float64(1.0 / F)))) - 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 <= -0.32)
		tmp = (F * (t_1 / ((-1.0 / F) - F))) - t_0;
	elseif ((F <= -1.3e-142) || (~((F <= 4.6e-193)) && (F <= 0.114)))
		tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
	else
		tmp = (F * (t_1 / (F + (1.0 / F)))) - 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, -0.32], N[(N[(F * N[(t$95$1 / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, -1.3e-142], And[N[Not[LessEqual[F, 4.6e-193]], $MachinePrecision], LessEqual[F, 0.114]]], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $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[(F * N[(t$95$1 / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 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 -0.32:\\
\;\;\;\;F \cdot \frac{t_1}{\frac{-1}{F} - F} - t_0\\

\mathbf{elif}\;F \leq -1.3 \cdot 10^{-142} \lor \neg \left(F \leq 4.6 \cdot 10^{-193}\right) \land F \leq 0.114:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{t_1}{F + \frac{1}{F}} - t_0\\


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

    1. Initial program 65.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. Step-by-step derivation
      1. distribute-lft-neg-in65.8%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv65.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified85.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}} \]
    4. Taylor expanded in x around 0 85.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/85.8%

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

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

      \[\leadsto F \cdot \frac{\frac{1}{\sin B}}{\color{blue}{-1 \cdot F - \frac{1}{F}}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. mul-1-neg99.4%

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

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

    if -0.320000000000000007 < F < -1.3e-142 or 4.60000000000000017e-193 < F < 0.114000000000000004

    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. Taylor expanded in F around 0 98.4%

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

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

    if -1.3e-142 < F < 4.60000000000000017e-193 or 0.114000000000000004 < F

    1. Initial program 75.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. Step-by-step derivation
      1. distribute-lft-neg-in75.0%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv75.0%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified81.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}} \]
    4. Taylor expanded in x around 0 81.8%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef81.8%

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/81.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.32:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{\frac{-1}{F} - F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.3 \cdot 10^{-142} \lor \neg \left(F \leq 4.6 \cdot 10^{-193}\right) \land F \leq 0.114:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 10: 85.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -6.2 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -6.2e-28)
     (- (/ -1.0 (sin B)) t_0)
     (- (* F (/ (/ 1.0 (sin B)) (+ F (/ 1.0 F)))) t_0))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -6.2e-28) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else {
		tmp = (F * ((1.0 / sin(B)) / (F + (1.0 / F)))) - 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 <= (-6.2d-28)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else
        tmp = (f * ((1.0d0 / sin(b)) / (f + (1.0d0 / f)))) - 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 <= -6.2e-28) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else {
		tmp = (F * ((1.0 / Math.sin(B)) / (F + (1.0 / F)))) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -6.2e-28:
		tmp = (-1.0 / math.sin(B)) - t_0
	else:
		tmp = (F * ((1.0 / math.sin(B)) / (F + (1.0 / F)))) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -6.2e-28)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	else
		tmp = Float64(Float64(F * Float64(Float64(1.0 / sin(B)) / Float64(F + Float64(1.0 / F)))) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -6.2e-28)
		tmp = (-1.0 / sin(B)) - t_0;
	else
		tmp = (F * ((1.0 / sin(B)) / (F + (1.0 / F)))) - 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, -6.2e-28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - t_0\\


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

    1. Initial program 67.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. Step-by-step derivation
      1. distribute-lft-neg-in67.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv67.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified86.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}} \]
    4. Taylor expanded in x around 0 86.5%

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

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

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

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

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

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

    if -6.19999999999999984e-28 < F

    1. Initial program 82.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in82.7%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv82.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified87.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}} \]
    4. Taylor expanded in x around 0 87.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-/l/87.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.2 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{F + \frac{1}{F}} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 11: 71.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7 \cdot 10^{+212}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-14}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-17}:\\ \;\;\;\;-\frac{\cos B}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -7e+212)
     (- (* F (/ -1.0 (* F B))) t_0)
     (if (<= F -9.5e-14)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 5.1e-17)
         (- (/ (cos B) (/ (sin B) x)))
         (if (<= F 8.2e+82)
           (- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
           (- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -7e+212) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -9.5e-14) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 5.1e-17) {
		tmp = -(cos(B) / (sin(B) / x));
	} else if (F <= 8.2e+82) {
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / 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 <= (-7d+212)) then
        tmp = (f * ((-1.0d0) / (f * b))) - t_0
    else if (f <= (-9.5d-14)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 5.1d-17) then
        tmp = -(cos(b) / (sin(b) / x))
    else if (f <= 8.2d+82) then
        tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / 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 <= -7e+212) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -9.5e-14) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 5.1e-17) {
		tmp = -(Math.cos(B) / (Math.sin(B) / x));
	} else if (F <= 8.2e+82) {
		tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -7e+212:
		tmp = (F * (-1.0 / (F * B))) - t_0
	elif F <= -9.5e-14:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 5.1e-17:
		tmp = -(math.cos(B) / (math.sin(B) / x))
	elif F <= 8.2e+82:
		tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -7e+212)
		tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0);
	elseif (F <= -9.5e-14)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 5.1e-17)
		tmp = Float64(-Float64(cos(B) / Float64(sin(B) / x)));
	elseif (F <= 8.2e+82)
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -7e+212)
		tmp = (F * (-1.0 / (F * B))) - t_0;
	elseif (F <= -9.5e-14)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 5.1e-17)
		tmp = -(cos(B) / (sin(B) / x));
	elseif (F <= 8.2e+82)
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / 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, -7e+212], N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -9.5e-14], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.1e-17], (-N[(N[Cos[B], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 8.2e+82], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7 \cdot 10^{+212}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\

\mathbf{elif}\;F \leq -9.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq 8.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 58.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in58.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv58.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified82.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}} \]
    4. Taylor expanded in x around 0 82.7%

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

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

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

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

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

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

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

    if -6.99999999999999974e212 < F < -9.4999999999999999e-14

    1. Initial program 71.1%

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

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

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

    if -9.4999999999999999e-14 < F < 5.1000000000000003e-17

    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. Taylor expanded in F around -inf 35.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around inf 70.9%

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

        \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
      2. associate-/l*70.8%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
    5. Simplified70.8%

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

    if 5.1000000000000003e-17 < F < 8.1999999999999999e82

    1. Initial program 96.2%

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

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

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

    if 8.1999999999999999e82 < F

    1. Initial program 39.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. Step-by-step derivation
      1. distribute-lft-neg-in39.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv39.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified54.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}} \]
    4. Taylor expanded in F around inf 99.4%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*99.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{+212}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-14}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5.1 \cdot 10^{-17}:\\ \;\;\;\;-\frac{\cos B}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 12: 71.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\ \mathbf{elif}\;F \leq -1.85 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-18}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{+83}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -9e+213)
     (- (* F (/ -1.0 (* F B))) t_0)
     (if (<= F -1.85e-13)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 2.7e-18)
         (/ (* (- x) (cos B)) (sin B))
         (if (<= F 1.9e+83)
           (- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
           (- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -9e+213) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -1.85e-13) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 2.7e-18) {
		tmp = (-x * cos(B)) / sin(B);
	} else if (F <= 1.9e+83) {
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / 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 <= (-9d+213)) then
        tmp = (f * ((-1.0d0) / (f * b))) - t_0
    else if (f <= (-1.85d-13)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 2.7d-18) then
        tmp = (-x * cos(b)) / sin(b)
    else if (f <= 1.9d+83) then
        tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / 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 <= -9e+213) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -1.85e-13) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 2.7e-18) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else if (F <= 1.9e+83) {
		tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -9e+213:
		tmp = (F * (-1.0 / (F * B))) - t_0
	elif F <= -1.85e-13:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 2.7e-18:
		tmp = (-x * math.cos(B)) / math.sin(B)
	elif F <= 1.9e+83:
		tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -9e+213)
		tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0);
	elseif (F <= -1.85e-13)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 2.7e-18)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	elseif (F <= 1.9e+83)
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -9e+213)
		tmp = (F * (-1.0 / (F * B))) - t_0;
	elseif (F <= -1.85e-13)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 2.7e-18)
		tmp = (-x * cos(B)) / sin(B);
	elseif (F <= 1.9e+83)
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / 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, -9e+213], N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.85e-13], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-18], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e+83], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\

\mathbf{elif}\;F \leq -1.85 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.7 \cdot 10^{-18}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 1.9 \cdot 10^{+83}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 58.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in58.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv58.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified82.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}} \]
    4. Taylor expanded in x around 0 82.7%

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

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

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

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

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

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

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

    if -9.0000000000000003e213 < F < -1.84999999999999994e-13

    1. Initial program 71.1%

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

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

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

    if -1.84999999999999994e-13 < F < 2.69999999999999989e-18

    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. Taylor expanded in F around -inf 35.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around inf 70.9%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\cos B \cdot x\right)}{\sin B}} \]
      2. *-commutative70.9%

        \[\leadsto \frac{-1 \cdot \color{blue}{\left(x \cdot \cos B\right)}}{\sin B} \]
      3. associate-*r*70.9%

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
      4. neg-mul-170.9%

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

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

    if 2.69999999999999989e-18 < F < 1.9000000000000001e83

    1. Initial program 96.2%

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

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

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

    if 1.9000000000000001e83 < F

    1. Initial program 39.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. Step-by-step derivation
      1. distribute-lft-neg-in39.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv39.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified54.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}} \]
    4. Taylor expanded in F around inf 99.4%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*99.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.85 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-18}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{+83}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 13: 85.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-44}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin 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 -1.8e-28)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 8.5e-44)
       (/ (* (- x) (cos B)) (sin 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 <= -1.8e-28) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 8.5e-44) {
		tmp = (-x * cos(B)) / sin(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 <= (-1.8d-28)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 8.5d-44) then
        tmp = (-x * cos(b)) / sin(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 <= -1.8e-28) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 8.5e-44) {
		tmp = (-x * Math.cos(B)) / Math.sin(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 <= -1.8e-28:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 8.5e-44:
		tmp = (-x * math.cos(B)) / math.sin(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 <= -1.8e-28)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 8.5e-44)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(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 <= -1.8e-28)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 8.5e-44)
		tmp = (-x * cos(B)) / sin(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, -1.8e-28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 8.5e-44], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[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 -1.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 8.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. distribute-lft-neg-in67.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv67.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified86.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}} \]
    4. Taylor expanded in x around 0 86.5%

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

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

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

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

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

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

    if -1.7999999999999999e-28 < F < 8.5000000000000002e-44

    1. Initial program 99.6%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around inf 71.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\cos B \cdot x\right)}{\sin B}} \]
      2. *-commutative71.4%

        \[\leadsto \frac{-1 \cdot \color{blue}{\left(x \cdot \cos B\right)}}{\sin B} \]
      3. associate-*r*71.4%

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
      4. neg-mul-171.4%

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
    5. Simplified71.4%

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

    if 8.5000000000000002e-44 < F

    1. Initial program 62.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. Step-by-step derivation
      1. distribute-lft-neg-in62.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv62.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified72.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}} \]
    4. Taylor expanded in x around 0 72.6%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef72.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-44}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 14: 78.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -8.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-17}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{+86}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -8.5e-26)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 2.15e-17)
       (/ (* (- x) (cos B)) (sin B))
       (if (<= F 7.4e+86)
         (- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
         (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -8.5e-26) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 2.15e-17) {
		tmp = (-x * cos(B)) / sin(B);
	} else if (F <= 7.4e+86) {
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / 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 <= (-8.5d-26)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 2.15d-17) then
        tmp = (-x * cos(b)) / sin(b)
    else if (f <= 7.4d+86) then
        tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / 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 <= -8.5e-26) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 2.15e-17) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else if (F <= 7.4e+86) {
		tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -8.5e-26:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 2.15e-17:
		tmp = (-x * math.cos(B)) / math.sin(B)
	elif F <= 7.4e+86:
		tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -8.5e-26)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 2.15e-17)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	elseif (F <= 7.4e+86)
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -8.5e-26)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 2.15e-17)
		tmp = (-x * cos(B)) / sin(B);
	elseif (F <= 7.4e+86)
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / 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, -8.5e-26], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.15e-17], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.4e+86], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 2.15 \cdot 10^{-17}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\

\mathbf{elif}\;F \leq 7.4 \cdot 10^{+86}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.50000000000000004e-26

    1. Initial program 67.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. Step-by-step derivation
      1. distribute-lft-neg-in67.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv67.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified86.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}} \]
    4. Taylor expanded in x around 0 86.5%

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

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

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

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

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

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

    if -8.50000000000000004e-26 < F < 2.15000000000000012e-17

    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. Taylor expanded in F around -inf 34.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around inf 71.2%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\cos B \cdot x\right)}{\sin B}} \]
      2. *-commutative71.2%

        \[\leadsto \frac{-1 \cdot \color{blue}{\left(x \cdot \cos B\right)}}{\sin B} \]
      3. associate-*r*71.2%

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot x\right) \cdot \cos B}}{\sin B} \]
      4. neg-mul-171.2%

        \[\leadsto \frac{\color{blue}{\left(-x\right)} \cdot \cos B}{\sin B} \]
    5. Simplified71.2%

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

    if 2.15000000000000012e-17 < F < 7.39999999999999983e86

    1. Initial program 96.2%

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

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

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

    if 7.39999999999999983e86 < F

    1. Initial program 39.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. Step-by-step derivation
      1. distribute-lft-neg-in39.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv39.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified54.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}} \]
    4. Taylor expanded in F around inf 99.4%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*99.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.15 \cdot 10^{-17}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{+86}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 15: 64.3% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\ \mathbf{elif}\;F \leq -0.0028:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.0053:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -9e+213)
     (- (* F (/ -1.0 (* F B))) t_0)
     (if (<= F -0.0028)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 0.0053)
         (/ (- (* F (sqrt 0.5)) x) B)
         (if (<= F 5.8e+82)
           (- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
           (- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -9e+213) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -0.0028) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 0.0053) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else if (F <= 5.8e+82) {
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / 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 <= (-9d+213)) then
        tmp = (f * ((-1.0d0) / (f * b))) - t_0
    else if (f <= (-0.0028d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 0.0053d0) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else if (f <= 5.8d+82) then
        tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / 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 <= -9e+213) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -0.0028) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 0.0053) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else if (F <= 5.8e+82) {
		tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -9e+213:
		tmp = (F * (-1.0 / (F * B))) - t_0
	elif F <= -0.0028:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 0.0053:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	elif F <= 5.8e+82:
		tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -9e+213)
		tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0);
	elseif (F <= -0.0028)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 0.0053)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	elseif (F <= 5.8e+82)
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -9e+213)
		tmp = (F * (-1.0 / (F * B))) - t_0;
	elseif (F <= -0.0028)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 0.0053)
		tmp = ((F * sqrt(0.5)) - x) / B;
	elseif (F <= 5.8e+82)
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / 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, -9e+213], N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -0.0028], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0053], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.8e+82], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\

\mathbf{elif}\;F \leq -0.0028:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq 5.8 \cdot 10^{+82}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 58.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in58.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv58.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified82.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}} \]
    4. Taylor expanded in x around 0 82.7%

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

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

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

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

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

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

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

    if -9.0000000000000003e213 < F < -0.00279999999999999997

    1. Initial program 69.7%

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

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

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

    if -0.00279999999999999997 < F < 0.00530000000000000002

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. 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}} \]
    4. Taylor expanded in x around 0 99.6%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef99.6%

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

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

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

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

    if 0.00530000000000000002 < F < 5.8000000000000003e82

    1. Initial program 95.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. Taylor expanded in F around inf 88.7%

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

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

    if 5.8000000000000003e82 < F

    1. Initial program 39.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. Step-by-step derivation
      1. distribute-lft-neg-in39.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv39.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified54.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}} \]
    4. Taylor expanded in F around inf 99.4%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*99.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.0028:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.0053:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 16: 61.5% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -0.039:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -9.0000000000000003e213 or 3.70000000000000015e-39 < F

    1. Initial program 61.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in61.5%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. 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}} \]
    4. Taylor expanded in F around inf 89.4%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*89.5%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified89.5%

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

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

    if -9.0000000000000003e213 < F < -0.0389999999999999999

    1. Initial program 69.7%

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

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

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

    if -0.0389999999999999999 < F < 3.70000000000000015e-39

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. 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}} \]
    4. Taylor expanded in x around 0 99.6%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef99.6%

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.039:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-39}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 17: 63.9% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\ \mathbf{elif}\;F \leq -0.0265:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-39}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -9e+213)
     (- (* F (/ -1.0 (* F B))) t_0)
     (if (<= F -0.0265)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 3e-39) (/ (- (* F (sqrt 0.5)) x) B) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -9e+213) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -0.0265) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 3e-39) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else {
		tmp = (1.0 / 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 <= (-9d+213)) then
        tmp = (f * ((-1.0d0) / (f * b))) - t_0
    else if (f <= (-0.0265d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 3d-39) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else
        tmp = (1.0d0 / 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 <= -9e+213) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -0.0265) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 3e-39) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -9e+213:
		tmp = (F * (-1.0 / (F * B))) - t_0
	elif F <= -0.0265:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 3e-39:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -9e+213)
		tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0);
	elseif (F <= -0.0265)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 3e-39)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -9e+213)
		tmp = (F * (-1.0 / (F * B))) - t_0;
	elseif (F <= -0.0265)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 3e-39)
		tmp = ((F * sqrt(0.5)) - x) / B;
	else
		tmp = (1.0 / 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, -9e+213], N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -0.0265], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3e-39], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\

\mathbf{elif}\;F \leq -0.0265:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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


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

    1. Initial program 58.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in58.9%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv58.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified82.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}} \]
    4. Taylor expanded in x around 0 82.7%

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

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

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

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

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

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

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

    if -9.0000000000000003e213 < F < -0.0264999999999999993

    1. Initial program 69.7%

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

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

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

    if -0.0264999999999999993 < F < 3.00000000000000028e-39

    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. Step-by-step derivation
      1. distribute-lft-neg-in99.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. 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}} \]
    4. Taylor expanded in x around 0 99.6%

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}} \cdot \frac{1}{\sin B}\right) - \frac{x}{\tan B} \]
      3. fma-udef99.6%

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

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

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

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

    if 3.00000000000000028e-39 < F

    1. Initial program 62.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in62.2%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv62.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified72.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}} \]
    4. Taylor expanded in F around inf 91.4%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*91.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{+213}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.0265:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-39}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 18: 53.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq -1.2 \cdot 10^{-103} \lor \neg \left(B \leq 5.1 \cdot 10^{-101}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - -0.5 \cdot \left(B \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= B -1.2e-103) (not (<= B 5.1e-101)))
   (- (/ 1.0 B) (/ x (tan B)))
   (- (/ (- x) B) (* -0.5 (* B x)))))
double code(double F, double B, double x) {
	double tmp;
	if ((B <= -1.2e-103) || !(B <= 5.1e-101)) {
		tmp = (1.0 / B) - (x / tan(B));
	} else {
		tmp = (-x / B) - (-0.5 * (B * x));
	}
	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 <= (-1.2d-103)) .or. (.not. (b <= 5.1d-101))) then
        tmp = (1.0d0 / b) - (x / tan(b))
    else
        tmp = (-x / b) - ((-0.5d0) * (b * x))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((B <= -1.2e-103) || !(B <= 5.1e-101)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = (-x / B) - (-0.5 * (B * x));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (B <= -1.2e-103) or not (B <= 5.1e-101):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = (-x / B) - (-0.5 * (B * x))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((B <= -1.2e-103) || !(B <= 5.1e-101))
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.5 * Float64(B * x)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((B <= -1.2e-103) || ~((B <= 5.1e-101)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = (-x / B) - (-0.5 * (B * x));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[B, -1.2e-103], N[Not[LessEqual[B, 5.1e-101]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.5 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;B \leq -1.2 \cdot 10^{-103} \lor \neg \left(B \leq 5.1 \cdot 10^{-101}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - -0.5 \cdot \left(B \cdot x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < -1.2000000000000001e-103 or 5.1000000000000002e-101 < B

    1. Initial program 85.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. Step-by-step derivation
      1. distribute-lft-neg-in85.1%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv85.1%

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

      \[\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}} \]
    4. Taylor expanded in F around inf 57.2%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*57.3%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified57.3%

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

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

    if -1.2000000000000001e-103 < B < 5.1000000000000002e-101

    1. Initial program 67.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. Taylor expanded in F around -inf 50.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in x around inf 60.4%

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

        \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
      2. associate-/l*60.3%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
    5. Simplified60.3%

      \[\leadsto \color{blue}{-\frac{\cos B}{\frac{\sin B}{x}}} \]
    6. Taylor expanded in B around 0 60.3%

      \[\leadsto -\frac{\cos B}{\color{blue}{\frac{B}{x}}} \]
    7. Taylor expanded in B around 0 60.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.2 \cdot 10^{-103} \lor \neg \left(B \leq 5.1 \cdot 10^{-101}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B} - -0.5 \cdot \left(B \cdot x\right)\\ \end{array} \]

Alternative 19: 57.3% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-195} \lor \neg \left(x \leq 3.8 \cdot 10^{-73}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -1.05e-195) (not (<= x 3.8e-73)))
   (- (/ 1.0 B) (/ x (tan B)))
   (/ (- (* F (sqrt 0.5)) x) B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.05e-195) || !(x <= 3.8e-73)) {
		tmp = (1.0 / B) - (x / tan(B));
	} else {
		tmp = ((F * sqrt(0.5)) - 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 ((x <= (-1.05d-195)) .or. (.not. (x <= 3.8d-73))) then
        tmp = (1.0d0 / b) - (x / tan(b))
    else
        tmp = ((f * sqrt(0.5d0)) - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.05e-195) || !(x <= 3.8e-73)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -1.05e-195) or not (x <= 3.8e-73):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -1.05e-195) || !(x <= 3.8e-73))
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -1.05e-195) || ~((x <= 3.8e-73)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = ((F * sqrt(0.5)) - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.05e-195], N[Not[LessEqual[x, 3.8e-73]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-195} \lor \neg \left(x \leq 3.8 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05e-195 or 3.8000000000000003e-73 < x

    1. Initial program 80.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in80.4%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv80.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified92.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}} \]
    4. Taylor expanded in F around inf 63.3%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*63.3%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified63.3%

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

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

    if -1.05e-195 < x < 3.8000000000000003e-73

    1. Initial program 76.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. Step-by-step derivation
      1. distribute-lft-neg-in76.5%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified78.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}} \]
    4. Taylor expanded in x around 0 78.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-195} \lor \neg \left(x \leq 3.8 \cdot 10^{-73}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \end{array} \]

Alternative 20: 43.8% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.7 \cdot 10^{-74}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-43}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6.7e-74)
   (/ (- -1.0 x) B)
   (if (<= F 3.4e-43) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.7e-74) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.4e-43) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - 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 <= (-6.7d-74)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 3.4d-43) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.7e-74) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.4e-43) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6.7e-74:
		tmp = (-1.0 - x) / B
	elif F <= 3.4e-43:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6.7e-74)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3.4e-43)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -6.7e-74)
		tmp = (-1.0 - x) / B;
	elseif (F <= 3.4e-43)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6.7e-74], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-43], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.7 \cdot 10^{-74}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3.4 \cdot 10^{-43}:\\
\;\;\;\;\frac{-x}{B}\\

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


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

    1. Initial program 72.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. Taylor expanded in F around -inf 85.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/39.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. mul-1-neg39.4%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
    5. Simplified39.4%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/39.4%

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in39.4%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval39.4%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
      5. unsub-neg39.4%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    8. Simplified39.4%

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

    if -6.6999999999999996e-74 < F < 3.4000000000000001e-43

    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. Taylor expanded in F around -inf 33.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/23.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. mul-1-neg23.8%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
    5. Simplified23.8%

      \[\leadsto \color{blue}{\frac{-\left(1 + x\right)}{B}} \]
    6. Taylor expanded in x around inf 44.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-neg44.3%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac44.3%

        \[\leadsto \color{blue}{\frac{-x}{B}} \]
    8. Simplified44.3%

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

    if 3.4000000000000001e-43 < F

    1. Initial program 62.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. Step-by-step derivation
      1. distribute-lft-neg-in62.6%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. cancel-sign-sub-inv62.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
    3. Simplified72.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}} \]
    4. Taylor expanded in F around inf 90.4%

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot \sin B}} - \frac{x}{\tan B} \]
      2. associate-/r*90.5%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified90.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.7 \cdot 10^{-74}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-43}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 21: 36.7% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.75 \cdot 10^{-71}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.75e-71) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.75e-71) {
		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 <= (-1.75d-71)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = -x / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.75e-71) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.75e-71:
		tmp = (-1.0 - x) / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.75e-71)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.75e-71)
		tmp = (-1.0 - x) / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.75e-71], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.75 \cdot 10^{-71}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


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

    1. Initial program 72.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. Taylor expanded in F around -inf 85.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/39.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. mul-1-neg39.4%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
    5. Simplified39.4%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/39.4%

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

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in39.4%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval39.4%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
      5. unsub-neg39.4%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    8. Simplified39.4%

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

    if -1.75e-71 < F

    1. Initial program 81.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/23.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. mul-1-neg23.0%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
    5. Simplified23.0%

      \[\leadsto \color{blue}{\frac{-\left(1 + x\right)}{B}} \]
    6. Taylor expanded in x around inf 33.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. mul-1-neg33.8%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac33.8%

        \[\leadsto \color{blue}{\frac{-x}{B}} \]
    8. Simplified33.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.75 \cdot 10^{-71}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 22: 29.2% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
	return -x / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -x / b
end function
public static double code(double F, double B, double x) {
	return -x / B;
}
def code(F, B, x):
	return -x / B
function code(F, B, x)
	return Float64(Float64(-x) / B)
end
function tmp = code(F, B, x)
	tmp = -x / B;
end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-x}{B}
\end{array}
Derivation
  1. Initial program 79.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. Taylor expanded in F around -inf 50.5%

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

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  4. Step-by-step derivation
    1. associate-*r/27.8%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. mul-1-neg27.8%

      \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
  5. Simplified27.8%

    \[\leadsto \color{blue}{\frac{-\left(1 + x\right)}{B}} \]
  6. Taylor expanded in x around inf 30.0%

    \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
  7. Step-by-step derivation
    1. mul-1-neg30.0%

      \[\leadsto \color{blue}{-\frac{x}{B}} \]
    2. distribute-neg-frac30.0%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  8. Simplified30.0%

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  9. Final simplification30.0%

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

Alternative 23: 10.8% 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 79.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. Taylor expanded in F around -inf 50.5%

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

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  4. Step-by-step derivation
    1. associate-*r/27.8%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. mul-1-neg27.8%

      \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
  5. Simplified27.8%

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification8.9%

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

Reproduce

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