VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.7% → 99.1%
Time: 21.0s
Alternatives: 21
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 21 alternatives:

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

Initial Program: 77.7% 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.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 59.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-in59.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. +-commutative59.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-inv59.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. 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. Step-by-step derivation
      1. clear-num72.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.7000000000000001e110 < F < 2e8

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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. fma-def99.5%

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

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

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

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

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

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

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

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

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

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

    if 2e8 < F

    1. Initial program 61.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-in61.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. +-commutative61.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-inv61.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. Simplified75.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. Step-by-step derivation
      1. clear-num75.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. 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.7 \cdot 10^{+110}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 2: 99.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -104000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 115000000:\\ \;\;\;\;F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -104000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 115000000.0)
       (- (* F (/ 1.0 (/ (sin B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -104000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 115000000.0) {
		tmp = (F * (1.0 / (sin(B) / pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)))) - 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 <= -104000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 115000000.0)
		tmp = Float64(Float64(F * Float64(1.0 / Float64(sin(B) / (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)))) - 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, -104000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 115000000.0], N[(N[(F * N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $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 -104000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

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

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


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

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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. Simplified82.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. Step-by-step derivation
      1. clear-num82.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.04e8 < F < 1.15e8

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e8 < F

    1. Initial program 61.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-in61.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. +-commutative61.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-inv61.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. Simplified75.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. Step-by-step derivation
      1. clear-num75.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. 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 -104000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 115000000:\\ \;\;\;\;F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 3: 99.7% accurate, 0.6× speedup?

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

\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;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 < -7e15

    1. Initial program 73.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-in73.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. +-commutative73.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-inv73.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. Simplified82.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. Step-by-step derivation
      1. clear-num81.9%

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

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

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

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

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

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

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

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

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

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

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

    if -7e15 < F < 2e8

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.6%

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

    if 2e8 < F

    1. Initial program 61.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-in61.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. +-commutative61.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-inv61.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. Simplified75.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. Step-by-step derivation
      1. clear-num75.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. 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 -7 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 200000000:\\ \;\;\;\;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 4: 99.0% accurate, 0.6× speedup?

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

\mathbf{elif}\;F \leq 50:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\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.7000000000000001e110

    1. Initial program 59.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-in59.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. +-commutative59.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-inv59.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. 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. Step-by-step derivation
      1. clear-num72.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.7000000000000001e110 < F < 50

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. un-div-inv66.4%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv66.4%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip66.4%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval66.4%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/266.4%

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

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

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

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

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

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

    if 50 < F

    1. Initial program 61.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-in61.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. +-commutative61.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-inv61.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. Simplified75.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. Step-by-step derivation
      1. clear-num75.4%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 4.6 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \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 < -5.9e5

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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.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. Step-by-step derivation
      1. clear-num82.7%

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

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

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

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

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

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

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

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

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

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

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

    if -5.9e5 < F < 4.6e14

    1. Initial program 99.5%

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

    if 4.6e14 < F

    1. Initial program 61.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-in61.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. +-commutative61.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-inv61.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. Simplified75.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. Step-by-step derivation
      1. clear-num75.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. 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 -590000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \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.1% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 0.9:\\
\;\;\;\;F \cdot \left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t_0\\

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


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

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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. Simplified82.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. Step-by-step derivation
      1. clear-num82.5%

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

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

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

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

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

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

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

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

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

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

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

    if -6e5 < F < 0.900000000000000022

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.6%

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

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

    if 0.900000000000000022 < F

    1. Initial program 62.3%

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

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

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

        \[\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. Simplified75.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. Step-by-step derivation
      1. clear-num75.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv63.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip63.1%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/263.1%

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

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

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

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

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

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

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

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

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

Alternative 7: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -600000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 1.3:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2 + x \cdot 2}} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -600000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1.3)
       (- (/ (/ F (sin B)) (sqrt (+ 2.0 (* x 2.0)))) t_0)
       (- (/ F (* (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 <= -600000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1.3) {
		tmp = ((F / sin(B)) / sqrt((2.0 + (x * 2.0)))) - t_0;
	} else {
		tmp = (F / (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 <= (-600000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1.3d0) then
        tmp = ((f / sin(b)) / sqrt((2.0d0 + (x * 2.0d0)))) - t_0
    else
        tmp = (f / (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 <= -600000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1.3) {
		tmp = ((F / Math.sin(B)) / Math.sqrt((2.0 + (x * 2.0)))) - t_0;
	} else {
		tmp = (F / (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 <= -600000.0:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1.3:
		tmp = ((F / math.sin(B)) / math.sqrt((2.0 + (x * 2.0)))) - t_0
	else:
		tmp = (F / (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 <= -600000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1.3)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(Float64(2.0 + Float64(x * 2.0)))) - t_0);
	else
		tmp = Float64(Float64(F / Float64(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 <= -600000.0)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1.3)
		tmp = ((F / sin(B)) / sqrt((2.0 + (x * 2.0)))) - t_0;
	else
		tmp = (F / (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, -600000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.3], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $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 -600000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 1.3:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2 + x \cdot 2}} - t_0\\

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


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

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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. Simplified82.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. Step-by-step derivation
      1. clear-num82.5%

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

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

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

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

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

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

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

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

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

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

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

    if -6e5 < F < 1.30000000000000004

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. expm1-log1p-u89.0%

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv70.7%

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/270.7%

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

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

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

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

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

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

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

    if 1.30000000000000004 < F

    1. Initial program 62.3%

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

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

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

        \[\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. Simplified75.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. Step-by-step derivation
      1. clear-num75.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv63.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip63.1%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/263.1%

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

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

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

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

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

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

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

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

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

Alternative 8: 91.5% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq -2.9 \cdot 10^{-121}:\\
\;\;\;\;\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 3.15 \cdot 10^{-27}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - t_0\\

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


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

    1. Initial program 73.3%

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

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

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

        \[\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.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. Step-by-step derivation
      1. clear-num81.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.42e20 < F < -2.9e-121

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

      \[\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 -2.9e-121 < F < 3.15000000000000005e-27

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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 F around 0 99.7%

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

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

    if 3.15000000000000005e-27 < F

    1. Initial program 63.3%

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

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

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

        \[\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. Simplified76.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. Step-by-step derivation
      1. clear-num76.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. un-div-inv63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/263.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.42 \cdot 10^{+20}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.9 \cdot 10^{-121}:\\ \;\;\;\;\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 3.15 \cdot 10^{-27}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 9: 85.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 9.5 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_1}{F}} - t_0\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-27}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_1}} - x}{B}\\

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


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

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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.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. Step-by-step derivation
      1. clear-num82.7%

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000033e-4 < F < -2.1e-120

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]
      2. *-commutative83.8%

        \[\leadsto \color{blue}{\left(\sqrt{0.5} \cdot F\right)} \cdot \frac{1}{\sin B} \]
      3. associate-*l*83.9%

        \[\leadsto \color{blue}{\sqrt{0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right)} \]
      4. div-inv84.2%

        \[\leadsto \sqrt{0.5} \cdot \color{blue}{\frac{F}{\sin B}} \]
    7. Applied egg-rr84.2%

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

    if -2.1e-120 < F < 9.4999999999999999e-107

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/281.3%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{\frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. associate-/r*84.5%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
      2. associate-*r/84.5%

        \[\leadsto \frac{\frac{F}{B}}{F + \color{blue}{\frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}}} - \frac{x}{\tan B} \]
    15. Simplified84.5%

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

    if 9.4999999999999999e-107 < F < 2.8e-27

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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.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 0 99.6%

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

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

    if 2.8e-27 < F

    1. Initial program 63.3%

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

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

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

        \[\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. Simplified76.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. Step-by-step derivation
      1. clear-num76.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. un-div-inv63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/263.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00055:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-120}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 9.5 \cdot 10^{-107}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-27}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 10: 89.6% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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.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. Step-by-step derivation
      1. clear-num82.7%

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

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

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

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

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

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

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

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

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

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

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

    if -0.00440000000000000027 < F < -2.1e-120

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]
      2. *-commutative83.8%

        \[\leadsto \color{blue}{\left(\sqrt{0.5} \cdot F\right)} \cdot \frac{1}{\sin B} \]
      3. associate-*l*83.9%

        \[\leadsto \color{blue}{\sqrt{0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right)} \]
      4. div-inv84.2%

        \[\leadsto \sqrt{0.5} \cdot \color{blue}{\frac{F}{\sin B}} \]
    7. Applied egg-rr84.2%

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

    if -2.1e-120 < F < 3.15000000000000005e-27

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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 F around 0 99.7%

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

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

    if 3.15000000000000005e-27 < F

    1. Initial program 63.3%

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

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

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

        \[\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. Simplified76.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. Step-by-step derivation
      1. clear-num76.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. un-div-inv63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval63.8%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/263.8%

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

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

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

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

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

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

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

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

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

Alternative 11: 85.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_1}{F}} - t_0\\

\mathbf{elif}\;F \leq 3.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_1}} - x}{B}\\

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


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

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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.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. Step-by-step derivation
      1. clear-num82.7%

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

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

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

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

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

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

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

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

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

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

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

    if -9.5000000000000005e-6 < F < -7.9999999999999998e-121

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]
      2. *-commutative83.8%

        \[\leadsto \color{blue}{\left(\sqrt{0.5} \cdot F\right)} \cdot \frac{1}{\sin B} \]
      3. associate-*l*83.9%

        \[\leadsto \color{blue}{\sqrt{0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right)} \]
      4. div-inv84.2%

        \[\leadsto \sqrt{0.5} \cdot \color{blue}{\frac{F}{\sin B}} \]
    7. Applied egg-rr84.2%

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

    if -7.9999999999999998e-121 < F < 1.05000000000000002e-106

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/281.3%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{\frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. associate-/r*84.5%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
      2. associate-*r/84.5%

        \[\leadsto \frac{\frac{F}{B}}{F + \color{blue}{\frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}}} - \frac{x}{\tan B} \]
    15. Simplified84.5%

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

    if 1.05000000000000002e-106 < F < 3.5e-28

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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.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 0 99.6%

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

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

    if 3.5e-28 < F

    1. Initial program 63.3%

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

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

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

        \[\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. Simplified76.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. Step-by-step derivation
      1. clear-num76.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8 \cdot 10^{-121}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-28}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 12: 70.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F}{\sin B}\\ t_1 := 2 + x \cdot 2\\ t_2 := \frac{x}{\tan B}\\ t_3 := \frac{-1}{B} - t_2\\ \mathbf{if}\;F \leq -2.7 \cdot 10^{+107}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{+84}:\\ \;\;\;\;t_0 \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.2 \cdot 10^{-7}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-121}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_1}{F}} - t_2\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_1}} - x}{B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{+77} \lor \neg \left(F \leq 8 \cdot 10^{+163}\right) \land F \leq 2 \cdot 10^{+206}:\\ \;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ F (sin B)))
        (t_1 (+ 2.0 (* x 2.0)))
        (t_2 (/ x (tan B)))
        (t_3 (- (/ -1.0 B) t_2)))
   (if (<= F -2.7e+107)
     t_3
     (if (<= F -1.45e+84)
       (- (* t_0 (/ -1.0 F)) (/ x B))
       (if (<= F -9.2e-7)
         t_3
         (if (<= F -3.2e-121)
           (* F (/ (sqrt 0.5) (sin B)))
           (if (<= F 2.1e-106)
             (- (/ (/ F B) (+ F (/ (* 0.5 t_1) F))) t_2)
             (if (<= F 1.65e-6)
               (/ (- (* F (sqrt (/ 1.0 t_1))) x) B)
               (if (or (<= F 7.4e+77) (and (not (<= F 8e+163)) (<= F 2e+206)))
                 (- (* t_0 (/ 1.0 F)) (/ x B))
                 (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))))))
double code(double F, double B, double x) {
	double t_0 = F / sin(B);
	double t_1 = 2.0 + (x * 2.0);
	double t_2 = x / tan(B);
	double t_3 = (-1.0 / B) - t_2;
	double tmp;
	if (F <= -2.7e+107) {
		tmp = t_3;
	} else if (F <= -1.45e+84) {
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	} else if (F <= -9.2e-7) {
		tmp = t_3;
	} else if (F <= -3.2e-121) {
		tmp = F * (sqrt(0.5) / sin(B));
	} else if (F <= 2.1e-106) {
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2;
	} else if (F <= 1.65e-6) {
		tmp = ((F * sqrt((1.0 / t_1))) - x) / B;
	} else if ((F <= 7.4e+77) || (!(F <= 8e+163) && (F <= 2e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = f / sin(b)
    t_1 = 2.0d0 + (x * 2.0d0)
    t_2 = x / tan(b)
    t_3 = ((-1.0d0) / b) - t_2
    if (f <= (-2.7d+107)) then
        tmp = t_3
    else if (f <= (-1.45d+84)) then
        tmp = (t_0 * ((-1.0d0) / f)) - (x / b)
    else if (f <= (-9.2d-7)) then
        tmp = t_3
    else if (f <= (-3.2d-121)) then
        tmp = f * (sqrt(0.5d0) / sin(b))
    else if (f <= 2.1d-106) then
        tmp = ((f / b) / (f + ((0.5d0 * t_1) / f))) - t_2
    else if (f <= 1.65d-6) then
        tmp = ((f * sqrt((1.0d0 / t_1))) - x) / b
    else if ((f <= 7.4d+77) .or. (.not. (f <= 8d+163)) .and. (f <= 2d+206)) then
        tmp = (t_0 * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = F / Math.sin(B);
	double t_1 = 2.0 + (x * 2.0);
	double t_2 = x / Math.tan(B);
	double t_3 = (-1.0 / B) - t_2;
	double tmp;
	if (F <= -2.7e+107) {
		tmp = t_3;
	} else if (F <= -1.45e+84) {
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	} else if (F <= -9.2e-7) {
		tmp = t_3;
	} else if (F <= -3.2e-121) {
		tmp = F * (Math.sqrt(0.5) / Math.sin(B));
	} else if (F <= 2.1e-106) {
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2;
	} else if (F <= 1.65e-6) {
		tmp = ((F * Math.sqrt((1.0 / t_1))) - x) / B;
	} else if ((F <= 7.4e+77) || (!(F <= 8e+163) && (F <= 2e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = F / math.sin(B)
	t_1 = 2.0 + (x * 2.0)
	t_2 = x / math.tan(B)
	t_3 = (-1.0 / B) - t_2
	tmp = 0
	if F <= -2.7e+107:
		tmp = t_3
	elif F <= -1.45e+84:
		tmp = (t_0 * (-1.0 / F)) - (x / B)
	elif F <= -9.2e-7:
		tmp = t_3
	elif F <= -3.2e-121:
		tmp = F * (math.sqrt(0.5) / math.sin(B))
	elif F <= 2.1e-106:
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2
	elif F <= 1.65e-6:
		tmp = ((F * math.sqrt((1.0 / t_1))) - x) / B
	elif (F <= 7.4e+77) or (not (F <= 8e+163) and (F <= 2e+206)):
		tmp = (t_0 * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(F / sin(B))
	t_1 = Float64(2.0 + Float64(x * 2.0))
	t_2 = Float64(x / tan(B))
	t_3 = Float64(Float64(-1.0 / B) - t_2)
	tmp = 0.0
	if (F <= -2.7e+107)
		tmp = t_3;
	elseif (F <= -1.45e+84)
		tmp = Float64(Float64(t_0 * Float64(-1.0 / F)) - Float64(x / B));
	elseif (F <= -9.2e-7)
		tmp = t_3;
	elseif (F <= -3.2e-121)
		tmp = Float64(F * Float64(sqrt(0.5) / sin(B)));
	elseif (F <= 2.1e-106)
		tmp = Float64(Float64(Float64(F / B) / Float64(F + Float64(Float64(0.5 * t_1) / F))) - t_2);
	elseif (F <= 1.65e-6)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / t_1))) - x) / B);
	elseif ((F <= 7.4e+77) || (!(F <= 8e+163) && (F <= 2e+206)))
		tmp = Float64(Float64(t_0 * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = F / sin(B);
	t_1 = 2.0 + (x * 2.0);
	t_2 = x / tan(B);
	t_3 = (-1.0 / B) - t_2;
	tmp = 0.0;
	if (F <= -2.7e+107)
		tmp = t_3;
	elseif (F <= -1.45e+84)
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	elseif (F <= -9.2e-7)
		tmp = t_3;
	elseif (F <= -3.2e-121)
		tmp = F * (sqrt(0.5) / sin(B));
	elseif (F <= 2.1e-106)
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2;
	elseif (F <= 1.65e-6)
		tmp = ((F * sqrt((1.0 / t_1))) - x) / B;
	elseif ((F <= 7.4e+77) || (~((F <= 8e+163)) && (F <= 2e+206)))
		tmp = (t_0 * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(-1.0 / B), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[F, -2.7e+107], t$95$3, If[LessEqual[F, -1.45e+84], N[(N[(t$95$0 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.2e-7], t$95$3, If[LessEqual[F, -3.2e-121], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e-106], N[(N[(N[(F / B), $MachinePrecision] / N[(F + N[(N[(0.5 * t$95$1), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, 1.65e-6], N[(N[(N[(F * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 7.4e+77], And[N[Not[LessEqual[F, 8e+163]], $MachinePrecision], LessEqual[F, 2e+206]]], N[(N[(t$95$0 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.45 \cdot 10^{+84}:\\
\;\;\;\;t_0 \cdot \frac{-1}{F} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -9.2 \cdot 10^{-7}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;F \leq 2.1 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_1}{F}} - t_2\\

\mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_1}} - x}{B}\\

\mathbf{elif}\;F \leq 7.4 \cdot 10^{+77} \lor \neg \left(F \leq 8 \cdot 10^{+163}\right) \land F \leq 2 \cdot 10^{+206}:\\
\;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if F < -2.7000000000000001e107 or -1.44999999999999994e84 < F < -9.1999999999999998e-7

    1. Initial program 71.3%

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

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

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

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

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

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

    if -2.7000000000000001e107 < F < -1.44999999999999994e84

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

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

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

    if -9.1999999999999998e-7 < F < -3.20000000000000019e-121

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

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u66.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{F \cdot \sqrt{0.5}}{\sin B}\right)\right)} \]
      2. expm1-udef18.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{F \cdot \sqrt{0.5}}{\sin B}\right)} - 1} \]
      3. associate-/l*18.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}}\right)} - 1 \]
    7. Applied egg-rr18.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def66.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\right)\right)} \]
      2. expm1-log1p84.0%

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

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

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

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

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

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

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

    if -3.20000000000000019e-121 < F < 2.10000000000000003e-106

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/281.3%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{\frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. associate-/r*84.5%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
      2. associate-*r/84.5%

        \[\leadsto \frac{\frac{F}{B}}{F + \color{blue}{\frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}}} - \frac{x}{\tan B} \]
    15. Simplified84.5%

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

    if 2.10000000000000003e-106 < F < 1.65000000000000008e-6

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.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 0 99.7%

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

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

    if 1.65000000000000008e-6 < F < 7.3999999999999999e77 or 7.9999999999999995e163 < F < 2.0000000000000001e206

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

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

    if 7.3999999999999999e77 < F < 7.9999999999999995e163 or 2.0000000000000001e206 < F

    1. Initial program 63.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 83.0%

      \[\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(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+107}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{+84}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.2 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-121}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{+77} \lor \neg \left(F \leq 8 \cdot 10^{+163}\right) \land F \leq 2 \cdot 10^{+206}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 13: 70.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F}{\sin B}\\ t_1 := 2 + x \cdot 2\\ t_2 := \frac{x}{\tan B}\\ t_3 := \frac{-1}{B} - t_2\\ \mathbf{if}\;F \leq -2.1 \cdot 10^{+103}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq -2 \cdot 10^{+82}:\\ \;\;\;\;t_0 \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -0.175:\\ \;\;\;\;t_3\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-123}:\\ \;\;\;\;t_0 \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_1}{F}} - t_2\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_1}} - x}{B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{+81} \lor \neg \left(F \leq 9 \cdot 10^{+163}\right) \land F \leq 3.9 \cdot 10^{+206}:\\ \;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ F (sin B)))
        (t_1 (+ 2.0 (* x 2.0)))
        (t_2 (/ x (tan B)))
        (t_3 (- (/ -1.0 B) t_2)))
   (if (<= F -2.1e+103)
     t_3
     (if (<= F -2e+82)
       (- (* t_0 (/ -1.0 F)) (/ x B))
       (if (<= F -0.175)
         t_3
         (if (<= F -2.1e-123)
           (* t_0 (sqrt 0.5))
           (if (<= F 3.5e-106)
             (- (/ (/ F B) (+ F (/ (* 0.5 t_1) F))) t_2)
             (if (<= F 1.6e-6)
               (/ (- (* F (sqrt (/ 1.0 t_1))) x) B)
               (if (or (<= F 7.4e+81)
                       (and (not (<= F 9e+163)) (<= F 3.9e+206)))
                 (- (* t_0 (/ 1.0 F)) (/ x B))
                 (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))))))
double code(double F, double B, double x) {
	double t_0 = F / sin(B);
	double t_1 = 2.0 + (x * 2.0);
	double t_2 = x / tan(B);
	double t_3 = (-1.0 / B) - t_2;
	double tmp;
	if (F <= -2.1e+103) {
		tmp = t_3;
	} else if (F <= -2e+82) {
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	} else if (F <= -0.175) {
		tmp = t_3;
	} else if (F <= -2.1e-123) {
		tmp = t_0 * sqrt(0.5);
	} else if (F <= 3.5e-106) {
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2;
	} else if (F <= 1.6e-6) {
		tmp = ((F * sqrt((1.0 / t_1))) - x) / B;
	} else if ((F <= 7.4e+81) || (!(F <= 9e+163) && (F <= 3.9e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = f / sin(b)
    t_1 = 2.0d0 + (x * 2.0d0)
    t_2 = x / tan(b)
    t_3 = ((-1.0d0) / b) - t_2
    if (f <= (-2.1d+103)) then
        tmp = t_3
    else if (f <= (-2d+82)) then
        tmp = (t_0 * ((-1.0d0) / f)) - (x / b)
    else if (f <= (-0.175d0)) then
        tmp = t_3
    else if (f <= (-2.1d-123)) then
        tmp = t_0 * sqrt(0.5d0)
    else if (f <= 3.5d-106) then
        tmp = ((f / b) / (f + ((0.5d0 * t_1) / f))) - t_2
    else if (f <= 1.6d-6) then
        tmp = ((f * sqrt((1.0d0 / t_1))) - x) / b
    else if ((f <= 7.4d+81) .or. (.not. (f <= 9d+163)) .and. (f <= 3.9d+206)) then
        tmp = (t_0 * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = F / Math.sin(B);
	double t_1 = 2.0 + (x * 2.0);
	double t_2 = x / Math.tan(B);
	double t_3 = (-1.0 / B) - t_2;
	double tmp;
	if (F <= -2.1e+103) {
		tmp = t_3;
	} else if (F <= -2e+82) {
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	} else if (F <= -0.175) {
		tmp = t_3;
	} else if (F <= -2.1e-123) {
		tmp = t_0 * Math.sqrt(0.5);
	} else if (F <= 3.5e-106) {
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2;
	} else if (F <= 1.6e-6) {
		tmp = ((F * Math.sqrt((1.0 / t_1))) - x) / B;
	} else if ((F <= 7.4e+81) || (!(F <= 9e+163) && (F <= 3.9e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = F / math.sin(B)
	t_1 = 2.0 + (x * 2.0)
	t_2 = x / math.tan(B)
	t_3 = (-1.0 / B) - t_2
	tmp = 0
	if F <= -2.1e+103:
		tmp = t_3
	elif F <= -2e+82:
		tmp = (t_0 * (-1.0 / F)) - (x / B)
	elif F <= -0.175:
		tmp = t_3
	elif F <= -2.1e-123:
		tmp = t_0 * math.sqrt(0.5)
	elif F <= 3.5e-106:
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2
	elif F <= 1.6e-6:
		tmp = ((F * math.sqrt((1.0 / t_1))) - x) / B
	elif (F <= 7.4e+81) or (not (F <= 9e+163) and (F <= 3.9e+206)):
		tmp = (t_0 * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(F / sin(B))
	t_1 = Float64(2.0 + Float64(x * 2.0))
	t_2 = Float64(x / tan(B))
	t_3 = Float64(Float64(-1.0 / B) - t_2)
	tmp = 0.0
	if (F <= -2.1e+103)
		tmp = t_3;
	elseif (F <= -2e+82)
		tmp = Float64(Float64(t_0 * Float64(-1.0 / F)) - Float64(x / B));
	elseif (F <= -0.175)
		tmp = t_3;
	elseif (F <= -2.1e-123)
		tmp = Float64(t_0 * sqrt(0.5));
	elseif (F <= 3.5e-106)
		tmp = Float64(Float64(Float64(F / B) / Float64(F + Float64(Float64(0.5 * t_1) / F))) - t_2);
	elseif (F <= 1.6e-6)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / t_1))) - x) / B);
	elseif ((F <= 7.4e+81) || (!(F <= 9e+163) && (F <= 3.9e+206)))
		tmp = Float64(Float64(t_0 * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = F / sin(B);
	t_1 = 2.0 + (x * 2.0);
	t_2 = x / tan(B);
	t_3 = (-1.0 / B) - t_2;
	tmp = 0.0;
	if (F <= -2.1e+103)
		tmp = t_3;
	elseif (F <= -2e+82)
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	elseif (F <= -0.175)
		tmp = t_3;
	elseif (F <= -2.1e-123)
		tmp = t_0 * sqrt(0.5);
	elseif (F <= 3.5e-106)
		tmp = ((F / B) / (F + ((0.5 * t_1) / F))) - t_2;
	elseif (F <= 1.6e-6)
		tmp = ((F * sqrt((1.0 / t_1))) - x) / B;
	elseif ((F <= 7.4e+81) || (~((F <= 9e+163)) && (F <= 3.9e+206)))
		tmp = (t_0 * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(-1.0 / B), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[F, -2.1e+103], t$95$3, If[LessEqual[F, -2e+82], N[(N[(t$95$0 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -0.175], t$95$3, If[LessEqual[F, -2.1e-123], N[(t$95$0 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-106], N[(N[(N[(F / B), $MachinePrecision] / N[(F + N[(N[(0.5 * t$95$1), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, 1.6e-6], N[(N[(N[(F * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 7.4e+81], And[N[Not[LessEqual[F, 9e+163]], $MachinePrecision], LessEqual[F, 3.9e+206]]], N[(N[(t$95$0 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq -0.175:\\
\;\;\;\;t_3\\

\mathbf{elif}\;F \leq -2.1 \cdot 10^{-123}:\\
\;\;\;\;t_0 \cdot \sqrt{0.5}\\

\mathbf{elif}\;F \leq 3.5 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_1}{F}} - t_2\\

\mathbf{elif}\;F \leq 1.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_1}} - x}{B}\\

\mathbf{elif}\;F \leq 7.4 \cdot 10^{+81} \lor \neg \left(F \leq 9 \cdot 10^{+163}\right) \land F \leq 3.9 \cdot 10^{+206}:\\
\;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if F < -2.1000000000000002e103 or -1.9999999999999999e82 < F < -0.17499999999999999

    1. Initial program 71.3%

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

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

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

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

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

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

    if -2.1000000000000002e103 < F < -1.9999999999999999e82

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

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

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

    if -0.17499999999999999 < F < -2.0999999999999999e-123

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]
      2. *-commutative83.8%

        \[\leadsto \color{blue}{\left(\sqrt{0.5} \cdot F\right)} \cdot \frac{1}{\sin B} \]
      3. associate-*l*83.9%

        \[\leadsto \color{blue}{\sqrt{0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right)} \]
      4. div-inv84.2%

        \[\leadsto \sqrt{0.5} \cdot \color{blue}{\frac{F}{\sin B}} \]
    7. Applied egg-rr84.2%

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

    if -2.0999999999999999e-123 < F < 3.5e-106

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/281.3%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{\frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. associate-/r*84.5%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
      2. associate-*r/84.5%

        \[\leadsto \frac{\frac{F}{B}}{F + \color{blue}{\frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}}} - \frac{x}{\tan B} \]
    15. Simplified84.5%

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

    if 3.5e-106 < F < 1.5999999999999999e-6

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.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 0 99.7%

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

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

    if 1.5999999999999999e-6 < F < 7.4000000000000001e81 or 8.99999999999999976e163 < F < 3.9e206

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

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

    if 7.4000000000000001e81 < F < 8.99999999999999976e163 or 3.9e206 < F

    1. Initial program 63.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 83.0%

      \[\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(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
  3. Recombined 7 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.1 \cdot 10^{+103}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -0.175:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-123}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{+81} \lor \neg \left(F \leq 9 \cdot 10^{+163}\right) \land F \leq 3.9 \cdot 10^{+206}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 14: 77.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F}{\sin B}\\ t_1 := \frac{x}{\tan B}\\ t_2 := 2 + x \cdot 2\\ \mathbf{if}\;F \leq -0.00041:\\ \;\;\;\;\frac{-1}{\sin B} - t_1\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{-125}:\\ \;\;\;\;t_0 \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_2}{F}} - t_1\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.32 \cdot 10^{+80} \lor \neg \left(F \leq 6.5 \cdot 10^{+163}\right) \land F \leq 2.6 \cdot 10^{+206}:\\ \;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ F (sin B))) (t_1 (/ x (tan B))) (t_2 (+ 2.0 (* x 2.0))))
   (if (<= F -0.00041)
     (- (/ -1.0 (sin B)) t_1)
     (if (<= F -1.45e-125)
       (* t_0 (sqrt 0.5))
       (if (<= F 5.8e-106)
         (- (/ (/ F B) (+ F (/ (* 0.5 t_2) F))) t_1)
         (if (<= F 1.65e-6)
           (/ (- (* F (sqrt (/ 1.0 t_2))) x) B)
           (if (or (<= F 1.32e+80) (and (not (<= F 6.5e+163)) (<= F 2.6e+206)))
             (- (* t_0 (/ 1.0 F)) (/ x B))
             (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))))
double code(double F, double B, double x) {
	double t_0 = F / sin(B);
	double t_1 = x / tan(B);
	double t_2 = 2.0 + (x * 2.0);
	double tmp;
	if (F <= -0.00041) {
		tmp = (-1.0 / sin(B)) - t_1;
	} else if (F <= -1.45e-125) {
		tmp = t_0 * sqrt(0.5);
	} else if (F <= 5.8e-106) {
		tmp = ((F / B) / (F + ((0.5 * t_2) / F))) - t_1;
	} else if (F <= 1.65e-6) {
		tmp = ((F * sqrt((1.0 / t_2))) - x) / B;
	} else if ((F <= 1.32e+80) || (!(F <= 6.5e+163) && (F <= 2.6e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = f / sin(b)
    t_1 = x / tan(b)
    t_2 = 2.0d0 + (x * 2.0d0)
    if (f <= (-0.00041d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_1
    else if (f <= (-1.45d-125)) then
        tmp = t_0 * sqrt(0.5d0)
    else if (f <= 5.8d-106) then
        tmp = ((f / b) / (f + ((0.5d0 * t_2) / f))) - t_1
    else if (f <= 1.65d-6) then
        tmp = ((f * sqrt((1.0d0 / t_2))) - x) / b
    else if ((f <= 1.32d+80) .or. (.not. (f <= 6.5d+163)) .and. (f <= 2.6d+206)) then
        tmp = (t_0 * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = F / Math.sin(B);
	double t_1 = x / Math.tan(B);
	double t_2 = 2.0 + (x * 2.0);
	double tmp;
	if (F <= -0.00041) {
		tmp = (-1.0 / Math.sin(B)) - t_1;
	} else if (F <= -1.45e-125) {
		tmp = t_0 * Math.sqrt(0.5);
	} else if (F <= 5.8e-106) {
		tmp = ((F / B) / (F + ((0.5 * t_2) / F))) - t_1;
	} else if (F <= 1.65e-6) {
		tmp = ((F * Math.sqrt((1.0 / t_2))) - x) / B;
	} else if ((F <= 1.32e+80) || (!(F <= 6.5e+163) && (F <= 2.6e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = F / math.sin(B)
	t_1 = x / math.tan(B)
	t_2 = 2.0 + (x * 2.0)
	tmp = 0
	if F <= -0.00041:
		tmp = (-1.0 / math.sin(B)) - t_1
	elif F <= -1.45e-125:
		tmp = t_0 * math.sqrt(0.5)
	elif F <= 5.8e-106:
		tmp = ((F / B) / (F + ((0.5 * t_2) / F))) - t_1
	elif F <= 1.65e-6:
		tmp = ((F * math.sqrt((1.0 / t_2))) - x) / B
	elif (F <= 1.32e+80) or (not (F <= 6.5e+163) and (F <= 2.6e+206)):
		tmp = (t_0 * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(F / sin(B))
	t_1 = Float64(x / tan(B))
	t_2 = Float64(2.0 + Float64(x * 2.0))
	tmp = 0.0
	if (F <= -0.00041)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
	elseif (F <= -1.45e-125)
		tmp = Float64(t_0 * sqrt(0.5));
	elseif (F <= 5.8e-106)
		tmp = Float64(Float64(Float64(F / B) / Float64(F + Float64(Float64(0.5 * t_2) / F))) - t_1);
	elseif (F <= 1.65e-6)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / t_2))) - x) / B);
	elseif ((F <= 1.32e+80) || (!(F <= 6.5e+163) && (F <= 2.6e+206)))
		tmp = Float64(Float64(t_0 * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = F / sin(B);
	t_1 = x / tan(B);
	t_2 = 2.0 + (x * 2.0);
	tmp = 0.0;
	if (F <= -0.00041)
		tmp = (-1.0 / sin(B)) - t_1;
	elseif (F <= -1.45e-125)
		tmp = t_0 * sqrt(0.5);
	elseif (F <= 5.8e-106)
		tmp = ((F / B) / (F + ((0.5 * t_2) / F))) - t_1;
	elseif (F <= 1.65e-6)
		tmp = ((F * sqrt((1.0 / t_2))) - x) / B;
	elseif ((F <= 1.32e+80) || (~((F <= 6.5e+163)) && (F <= 2.6e+206)))
		tmp = (t_0 * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00041], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.45e-125], N[(t$95$0 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.8e-106], N[(N[(N[(F / B), $MachinePrecision] / N[(F + N[(N[(0.5 * t$95$2), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.65e-6], N[(N[(N[(F * N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 1.32e+80], And[N[Not[LessEqual[F, 6.5e+163]], $MachinePrecision], LessEqual[F, 2.6e+206]]], N[(N[(t$95$0 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.45 \cdot 10^{-125}:\\
\;\;\;\;t_0 \cdot \sqrt{0.5}\\

\mathbf{elif}\;F \leq 5.8 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_2}{F}} - t_1\\

\mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t_2}} - x}{B}\\

\mathbf{elif}\;F \leq 1.32 \cdot 10^{+80} \lor \neg \left(F \leq 6.5 \cdot 10^{+163}\right) \land F \leq 2.6 \cdot 10^{+206}:\\
\;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\

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


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

    1. Initial program 74.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-in74.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. +-commutative74.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-inv74.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.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. Step-by-step derivation
      1. clear-num82.7%

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

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

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

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

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

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

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

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

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

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

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

    if -4.0999999999999999e-4 < F < -1.4500000000000001e-125

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]
      2. *-commutative83.8%

        \[\leadsto \color{blue}{\left(\sqrt{0.5} \cdot F\right)} \cdot \frac{1}{\sin B} \]
      3. associate-*l*83.9%

        \[\leadsto \color{blue}{\sqrt{0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right)} \]
      4. div-inv84.2%

        \[\leadsto \sqrt{0.5} \cdot \color{blue}{\frac{F}{\sin B}} \]
    7. Applied egg-rr84.2%

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

    if -1.4500000000000001e-125 < F < 5.8000000000000001e-106

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval81.3%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/281.3%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 84.5%

      \[\leadsto \color{blue}{\frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. associate-/r*84.5%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
      2. associate-*r/84.5%

        \[\leadsto \frac{\frac{F}{B}}{F + \color{blue}{\frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}}} - \frac{x}{\tan B} \]
    15. Simplified84.5%

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

    if 5.8000000000000001e-106 < F < 1.65000000000000008e-6

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.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 0 99.7%

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

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

    if 1.65000000000000008e-6 < F < 1.3200000000000001e80 or 6.4999999999999998e163 < F < 2.59999999999999989e206

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

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

    if 1.3200000000000001e80 < F < 6.4999999999999998e163 or 2.59999999999999989e206 < F

    1. Initial program 63.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 83.0%

      \[\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(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification87.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00041:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.45 \cdot 10^{-125}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.32 \cdot 10^{+80} \lor \neg \left(F \leq 6.5 \cdot 10^{+163}\right) \land F \leq 2.6 \cdot 10^{+206}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 15: 70.5% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{-1}{B} - t_0\\ t_2 := \frac{F}{\sin B}\\ t_3 := 2 + x \cdot 2\\ t_4 := \frac{F \cdot \sqrt{\frac{1}{t_3}} - x}{B}\\ \mathbf{if}\;F \leq -4.8 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.65 \cdot 10^{+82}:\\ \;\;\;\;t_2 \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -600000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-83}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-107}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_3}{F}} - t_0\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+81} \lor \neg \left(F \leq 2.1 \cdot 10^{+163}\right) \land F \leq 9 \cdot 10^{+206}:\\ \;\;\;\;t_2 \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B)))
        (t_1 (- (/ -1.0 B) t_0))
        (t_2 (/ F (sin B)))
        (t_3 (+ 2.0 (* x 2.0)))
        (t_4 (/ (- (* F (sqrt (/ 1.0 t_3))) x) B)))
   (if (<= F -4.8e+105)
     t_1
     (if (<= F -1.65e+82)
       (- (* t_2 (/ -1.0 F)) (/ x B))
       (if (<= F -600000.0)
         t_1
         (if (<= F -3.5e-83)
           t_4
           (if (<= F 6.5e-107)
             (- (/ (/ F B) (+ F (/ (* 0.5 t_3) F))) t_0)
             (if (<= F 1.65e-6)
               t_4
               (if (or (<= F 2.2e+81)
                       (and (not (<= F 2.1e+163)) (<= F 9e+206)))
                 (- (* t_2 (/ 1.0 F)) (/ x B))
                 (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = (-1.0 / B) - t_0;
	double t_2 = F / sin(B);
	double t_3 = 2.0 + (x * 2.0);
	double t_4 = ((F * sqrt((1.0 / t_3))) - x) / B;
	double tmp;
	if (F <= -4.8e+105) {
		tmp = t_1;
	} else if (F <= -1.65e+82) {
		tmp = (t_2 * (-1.0 / F)) - (x / B);
	} else if (F <= -600000.0) {
		tmp = t_1;
	} else if (F <= -3.5e-83) {
		tmp = t_4;
	} else if (F <= 6.5e-107) {
		tmp = ((F / B) / (F + ((0.5 * t_3) / F))) - t_0;
	} else if (F <= 1.65e-6) {
		tmp = t_4;
	} else if ((F <= 2.2e+81) || (!(F <= 2.1e+163) && (F <= 9e+206))) {
		tmp = (t_2 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = ((-1.0d0) / b) - t_0
    t_2 = f / sin(b)
    t_3 = 2.0d0 + (x * 2.0d0)
    t_4 = ((f * sqrt((1.0d0 / t_3))) - x) / b
    if (f <= (-4.8d+105)) then
        tmp = t_1
    else if (f <= (-1.65d+82)) then
        tmp = (t_2 * ((-1.0d0) / f)) - (x / b)
    else if (f <= (-600000.0d0)) then
        tmp = t_1
    else if (f <= (-3.5d-83)) then
        tmp = t_4
    else if (f <= 6.5d-107) then
        tmp = ((f / b) / (f + ((0.5d0 * t_3) / f))) - t_0
    else if (f <= 1.65d-6) then
        tmp = t_4
    else if ((f <= 2.2d+81) .or. (.not. (f <= 2.1d+163)) .and. (f <= 9d+206)) then
        tmp = (t_2 * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double t_1 = (-1.0 / B) - t_0;
	double t_2 = F / Math.sin(B);
	double t_3 = 2.0 + (x * 2.0);
	double t_4 = ((F * Math.sqrt((1.0 / t_3))) - x) / B;
	double tmp;
	if (F <= -4.8e+105) {
		tmp = t_1;
	} else if (F <= -1.65e+82) {
		tmp = (t_2 * (-1.0 / F)) - (x / B);
	} else if (F <= -600000.0) {
		tmp = t_1;
	} else if (F <= -3.5e-83) {
		tmp = t_4;
	} else if (F <= 6.5e-107) {
		tmp = ((F / B) / (F + ((0.5 * t_3) / F))) - t_0;
	} else if (F <= 1.65e-6) {
		tmp = t_4;
	} else if ((F <= 2.2e+81) || (!(F <= 2.1e+163) && (F <= 9e+206))) {
		tmp = (t_2 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = (-1.0 / B) - t_0
	t_2 = F / math.sin(B)
	t_3 = 2.0 + (x * 2.0)
	t_4 = ((F * math.sqrt((1.0 / t_3))) - x) / B
	tmp = 0
	if F <= -4.8e+105:
		tmp = t_1
	elif F <= -1.65e+82:
		tmp = (t_2 * (-1.0 / F)) - (x / B)
	elif F <= -600000.0:
		tmp = t_1
	elif F <= -3.5e-83:
		tmp = t_4
	elif F <= 6.5e-107:
		tmp = ((F / B) / (F + ((0.5 * t_3) / F))) - t_0
	elif F <= 1.65e-6:
		tmp = t_4
	elif (F <= 2.2e+81) or (not (F <= 2.1e+163) and (F <= 9e+206)):
		tmp = (t_2 * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(Float64(-1.0 / B) - t_0)
	t_2 = Float64(F / sin(B))
	t_3 = Float64(2.0 + Float64(x * 2.0))
	t_4 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / t_3))) - x) / B)
	tmp = 0.0
	if (F <= -4.8e+105)
		tmp = t_1;
	elseif (F <= -1.65e+82)
		tmp = Float64(Float64(t_2 * Float64(-1.0 / F)) - Float64(x / B));
	elseif (F <= -600000.0)
		tmp = t_1;
	elseif (F <= -3.5e-83)
		tmp = t_4;
	elseif (F <= 6.5e-107)
		tmp = Float64(Float64(Float64(F / B) / Float64(F + Float64(Float64(0.5 * t_3) / F))) - t_0);
	elseif (F <= 1.65e-6)
		tmp = t_4;
	elseif ((F <= 2.2e+81) || (!(F <= 2.1e+163) && (F <= 9e+206)))
		tmp = Float64(Float64(t_2 * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	t_1 = (-1.0 / B) - t_0;
	t_2 = F / sin(B);
	t_3 = 2.0 + (x * 2.0);
	t_4 = ((F * sqrt((1.0 / t_3))) - x) / B;
	tmp = 0.0;
	if (F <= -4.8e+105)
		tmp = t_1;
	elseif (F <= -1.65e+82)
		tmp = (t_2 * (-1.0 / F)) - (x / B);
	elseif (F <= -600000.0)
		tmp = t_1;
	elseif (F <= -3.5e-83)
		tmp = t_4;
	elseif (F <= 6.5e-107)
		tmp = ((F / B) / (F + ((0.5 * t_3) / F))) - t_0;
	elseif (F <= 1.65e-6)
		tmp = t_4;
	elseif ((F <= 2.2e+81) || (~((F <= 2.1e+163)) && (F <= 9e+206)))
		tmp = (t_2 * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	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[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(F * N[Sqrt[N[(1.0 / t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -4.8e+105], t$95$1, If[LessEqual[F, -1.65e+82], N[(N[(t$95$2 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -600000.0], t$95$1, If[LessEqual[F, -3.5e-83], t$95$4, If[LessEqual[F, 6.5e-107], N[(N[(N[(F / B), $MachinePrecision] / N[(F + N[(N[(0.5 * t$95$3), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.65e-6], t$95$4, If[Or[LessEqual[F, 2.2e+81], And[N[Not[LessEqual[F, 2.1e+163]], $MachinePrecision], LessEqual[F, 9e+206]]], N[(N[(t$95$2 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{-1}{B} - t_0\\
t_2 := \frac{F}{\sin B}\\
t_3 := 2 + x \cdot 2\\
t_4 := \frac{F \cdot \sqrt{\frac{1}{t_3}} - x}{B}\\
\mathbf{if}\;F \leq -4.8 \cdot 10^{+105}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq -600000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -3.5 \cdot 10^{-83}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;F \leq 6.5 \cdot 10^{-107}:\\
\;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot t_3}{F}} - t_0\\

\mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;F \leq 2.2 \cdot 10^{+81} \lor \neg \left(F \leq 2.1 \cdot 10^{+163}\right) \land F \leq 9 \cdot 10^{+206}:\\
\;\;\;\;t_2 \cdot \frac{1}{F} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -4.7999999999999995e105 or -1.6499999999999999e82 < F < -6e5

    1. Initial program 70.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-in70.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. +-commutative70.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-inv70.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. Simplified80.1%

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

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

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

    if -4.7999999999999995e105 < F < -1.6499999999999999e82

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

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

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

    if -6e5 < F < -3.5000000000000003e-83 or 6.5000000000000002e-107 < F < 1.65000000000000008e-6

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.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 0 99.5%

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

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

    if -3.5000000000000003e-83 < F < 6.5000000000000002e-107

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. 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. Step-by-step derivation
      1. clear-num99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}\right)} - 1\right)} - \frac{x}{\tan B} \]
      3. un-div-inv77.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv77.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip77.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      6. metadata-eval77.9%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/277.9%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 81.0%

      \[\leadsto \color{blue}{\frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. associate-/r*81.0%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
      2. associate-*r/81.0%

        \[\leadsto \frac{\frac{F}{B}}{F + \color{blue}{\frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}}} - \frac{x}{\tan B} \]
    15. Simplified81.0%

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

    if 1.65000000000000008e-6 < F < 2.19999999999999987e81 or 2.1e163 < F < 9.00000000000000035e206

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

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

    if 2.19999999999999987e81 < F < 2.1e163 or 9.00000000000000035e206 < F

    1. Initial program 63.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 83.0%

      \[\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(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification81.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{+105}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.65 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -600000:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-83}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-107}:\\ \;\;\;\;\frac{\frac{F}{B}}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{+81} \lor \neg \left(F \leq 2.1 \cdot 10^{+163}\right) \land F \leq 9 \cdot 10^{+206}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 16: 62.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F}{\sin B}\\ t_1 := \frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -5.5 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -3 \cdot 10^{+82}:\\ \;\;\;\;t_0 \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -600000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{+81} \lor \neg \left(F \leq 2.85 \cdot 10^{+163}\right) \land F \leq 9 \cdot 10^{+206}:\\ \;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ F (sin B))) (t_1 (- (/ -1.0 B) (/ x (tan B)))))
   (if (<= F -5.5e+105)
     t_1
     (if (<= F -3e+82)
       (- (* t_0 (/ -1.0 F)) (/ x B))
       (if (<= F -600000.0)
         t_1
         (if (<= F 1.65e-6)
           (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
           (if (or (<= F 1.4e+81) (and (not (<= F 2.85e+163)) (<= F 9e+206)))
             (- (* t_0 (/ 1.0 F)) (/ x B))
             (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))))
double code(double F, double B, double x) {
	double t_0 = F / sin(B);
	double t_1 = (-1.0 / B) - (x / tan(B));
	double tmp;
	if (F <= -5.5e+105) {
		tmp = t_1;
	} else if (F <= -3e+82) {
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	} else if (F <= -600000.0) {
		tmp = t_1;
	} else if (F <= 1.65e-6) {
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if ((F <= 1.4e+81) || (!(F <= 2.85e+163) && (F <= 9e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = f / sin(b)
    t_1 = ((-1.0d0) / b) - (x / tan(b))
    if (f <= (-5.5d+105)) then
        tmp = t_1
    else if (f <= (-3d+82)) then
        tmp = (t_0 * ((-1.0d0) / f)) - (x / b)
    else if (f <= (-600000.0d0)) then
        tmp = t_1
    else if (f <= 1.65d-6) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    else if ((f <= 1.4d+81) .or. (.not. (f <= 2.85d+163)) .and. (f <= 9d+206)) then
        tmp = (t_0 * (1.0d0 / f)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = F / Math.sin(B);
	double t_1 = (-1.0 / B) - (x / Math.tan(B));
	double tmp;
	if (F <= -5.5e+105) {
		tmp = t_1;
	} else if (F <= -3e+82) {
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	} else if (F <= -600000.0) {
		tmp = t_1;
	} else if (F <= 1.65e-6) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if ((F <= 1.4e+81) || (!(F <= 2.85e+163) && (F <= 9e+206))) {
		tmp = (t_0 * (1.0 / F)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = F / math.sin(B)
	t_1 = (-1.0 / B) - (x / math.tan(B))
	tmp = 0
	if F <= -5.5e+105:
		tmp = t_1
	elif F <= -3e+82:
		tmp = (t_0 * (-1.0 / F)) - (x / B)
	elif F <= -600000.0:
		tmp = t_1
	elif F <= 1.65e-6:
		tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	elif (F <= 1.4e+81) or (not (F <= 2.85e+163) and (F <= 9e+206)):
		tmp = (t_0 * (1.0 / F)) - (x / B)
	else:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	return tmp
function code(F, B, x)
	t_0 = Float64(F / sin(B))
	t_1 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	tmp = 0.0
	if (F <= -5.5e+105)
		tmp = t_1;
	elseif (F <= -3e+82)
		tmp = Float64(Float64(t_0 * Float64(-1.0 / F)) - Float64(x / B));
	elseif (F <= -600000.0)
		tmp = t_1;
	elseif (F <= 1.65e-6)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B);
	elseif ((F <= 1.4e+81) || (!(F <= 2.85e+163) && (F <= 9e+206)))
		tmp = Float64(Float64(t_0 * Float64(1.0 / F)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = F / sin(B);
	t_1 = (-1.0 / B) - (x / tan(B));
	tmp = 0.0;
	if (F <= -5.5e+105)
		tmp = t_1;
	elseif (F <= -3e+82)
		tmp = (t_0 * (-1.0 / F)) - (x / B);
	elseif (F <= -600000.0)
		tmp = t_1;
	elseif (F <= 1.65e-6)
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	elseif ((F <= 1.4e+81) || (~((F <= 2.85e+163)) && (F <= 9e+206)))
		tmp = (t_0 * (1.0 / F)) - (x / B);
	else
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.5e+105], t$95$1, If[LessEqual[F, -3e+82], N[(N[(t$95$0 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -600000.0], t$95$1, If[LessEqual[F, 1.65e-6], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 1.4e+81], And[N[Not[LessEqual[F, 2.85e+163]], $MachinePrecision], LessEqual[F, 9e+206]]], N[(N[(t$95$0 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq -600000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;F \leq 1.4 \cdot 10^{+81} \lor \neg \left(F \leq 2.85 \cdot 10^{+163}\right) \land F \leq 9 \cdot 10^{+206}:\\
\;\;\;\;t_0 \cdot \frac{1}{F} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -5.49999999999999979e105 or -2.99999999999999989e82 < F < -6e5

    1. Initial program 70.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-in70.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. +-commutative70.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-inv70.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. Simplified80.1%

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

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

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

    if -5.49999999999999979e105 < F < -2.99999999999999989e82

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

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

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

    if -6e5 < F < 1.65000000000000008e-6

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.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. +-commutative99.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-inv99.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. Simplified99.6%

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

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

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

    if 1.65000000000000008e-6 < F < 1.39999999999999997e81 or 2.8499999999999999e163 < F < 9.00000000000000035e206

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

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

    if 1.39999999999999997e81 < F < 2.8499999999999999e163 or 9.00000000000000035e206 < F

    1. Initial program 63.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 83.0%

      \[\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(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification72.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{+105}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{+82}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -600000:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{+81} \lor \neg \left(F \leq 2.85 \cdot 10^{+163}\right) \land F \leq 9 \cdot 10^{+206}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 17: 60.3% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\ t_1 := F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\\ \mathbf{if}\;B \leq -1.06 \cdot 10^{+220}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;B \leq -1.28 \cdot 10^{+188}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;B \leq -0.0028:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;B \leq 2.15 \cdot 10^{-11}:\\ \;\;\;\;\left(B \cdot \left(x \cdot 0.3333333333333333 - -0.16666666666666666 \cdot \frac{F}{t_1}\right) + \frac{F}{B \cdot t_1}\right) - \frac{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))))
        (t_1 (+ F (* 0.5 (/ (+ 2.0 (* x 2.0)) F)))))
   (if (<= B -1.06e+220)
     t_0
     (if (<= B -1.28e+188)
       (- (* (/ F (sin B)) (/ -1.0 F)) (/ x B))
       (if (<= B -0.0028)
         (- (/ 1.0 B) (* x (/ 1.0 (tan B))))
         (if (<= B 2.15e-11)
           (-
            (+
             (*
              B
              (- (* x 0.3333333333333333) (* -0.16666666666666666 (/ F t_1))))
             (/ F (* B t_1)))
            (/ x B))
           t_0))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / B) - (x / tan(B));
	double t_1 = F + (0.5 * ((2.0 + (x * 2.0)) / F));
	double tmp;
	if (B <= -1.06e+220) {
		tmp = t_0;
	} else if (B <= -1.28e+188) {
		tmp = ((F / sin(B)) * (-1.0 / F)) - (x / B);
	} else if (B <= -0.0028) {
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	} else if (B <= 2.15e-11) {
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_1)))) + (F / (B * t_1))) - (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) :: t_1
    real(8) :: tmp
    t_0 = ((-1.0d0) / b) - (x / tan(b))
    t_1 = f + (0.5d0 * ((2.0d0 + (x * 2.0d0)) / f))
    if (b <= (-1.06d+220)) then
        tmp = t_0
    else if (b <= (-1.28d+188)) then
        tmp = ((f / sin(b)) * ((-1.0d0) / f)) - (x / b)
    else if (b <= (-0.0028d0)) then
        tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
    else if (b <= 2.15d-11) then
        tmp = ((b * ((x * 0.3333333333333333d0) - ((-0.16666666666666666d0) * (f / t_1)))) + (f / (b * t_1))) - (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 t_1 = F + (0.5 * ((2.0 + (x * 2.0)) / F));
	double tmp;
	if (B <= -1.06e+220) {
		tmp = t_0;
	} else if (B <= -1.28e+188) {
		tmp = ((F / Math.sin(B)) * (-1.0 / F)) - (x / B);
	} else if (B <= -0.0028) {
		tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
	} else if (B <= 2.15e-11) {
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_1)))) + (F / (B * t_1))) - (x / B);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / B) - (x / math.tan(B))
	t_1 = F + (0.5 * ((2.0 + (x * 2.0)) / F))
	tmp = 0
	if B <= -1.06e+220:
		tmp = t_0
	elif B <= -1.28e+188:
		tmp = ((F / math.sin(B)) * (-1.0 / F)) - (x / B)
	elif B <= -0.0028:
		tmp = (1.0 / B) - (x * (1.0 / math.tan(B)))
	elif B <= 2.15e-11:
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_1)))) + (F / (B * t_1))) - (x / B)
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
	t_1 = Float64(F + Float64(0.5 * Float64(Float64(2.0 + Float64(x * 2.0)) / F)))
	tmp = 0.0
	if (B <= -1.06e+220)
		tmp = t_0;
	elseif (B <= -1.28e+188)
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(-1.0 / F)) - Float64(x / B));
	elseif (B <= -0.0028)
		tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	elseif (B <= 2.15e-11)
		tmp = Float64(Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - Float64(-0.16666666666666666 * Float64(F / t_1)))) + Float64(F / Float64(B * t_1))) - Float64(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));
	t_1 = F + (0.5 * ((2.0 + (x * 2.0)) / F));
	tmp = 0.0;
	if (B <= -1.06e+220)
		tmp = t_0;
	elseif (B <= -1.28e+188)
		tmp = ((F / sin(B)) * (-1.0 / F)) - (x / B);
	elseif (B <= -0.0028)
		tmp = (1.0 / B) - (x * (1.0 / tan(B)));
	elseif (B <= 2.15e-11)
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_1)))) + (F / (B * t_1))) - (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]}, Block[{t$95$1 = N[(F + N[(0.5 * N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -1.06e+220], t$95$0, If[LessEqual[B, -1.28e+188], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -0.0028], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.15e-11], N[(N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - N[(-0.16666666666666666 * N[(F / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(B * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;B \leq -0.0028:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\

\mathbf{elif}\;B \leq 2.15 \cdot 10^{-11}:\\
\;\;\;\;\left(B \cdot \left(x \cdot 0.3333333333333333 - -0.16666666666666666 \cdot \frac{F}{t_1}\right) + \frac{F}{B \cdot t_1}\right) - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < -1.05999999999999997e220 or 2.15000000000000001e-11 < B

    1. Initial program 89.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in89.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. +-commutative89.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-inv89.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. Simplified89.1%

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

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

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

    if -1.05999999999999997e220 < B < -1.27999999999999997e188

    1. Initial program 46.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 56.6%

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

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

    if -1.27999999999999997e188 < B < -0.00279999999999999997

    1. Initial program 95.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 51.6%

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

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

    if -0.00279999999999999997 < B < 2.15000000000000001e-11

    1. Initial program 77.3%

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

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

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

        \[\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. Simplified89.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. Step-by-step derivation
      1. clear-num89.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv60.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip60.1%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/260.1%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 69.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -1.06 \cdot 10^{+220}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;B \leq -1.28 \cdot 10^{+188}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{-1}{F} - \frac{x}{B}\\ \mathbf{elif}\;B \leq -0.0028:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;B \leq 2.15 \cdot 10^{-11}:\\ \;\;\;\;\left(B \cdot \left(x \cdot 0.3333333333333333 - -0.16666666666666666 \cdot \frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}\right) + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 18: 61.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\\ \mathbf{if}\;B \leq -0.0028 \lor \neg \left(B \leq 1.95 \cdot 10^{-11}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(B \cdot \left(x \cdot 0.3333333333333333 - -0.16666666666666666 \cdot \frac{F}{t_0}\right) + \frac{F}{B \cdot t_0}\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (+ F (* 0.5 (/ (+ 2.0 (* x 2.0)) F)))))
   (if (or (<= B -0.0028) (not (<= B 1.95e-11)))
     (- (/ -1.0 B) (/ x (tan B)))
     (-
      (+
       (* B (- (* x 0.3333333333333333) (* -0.16666666666666666 (/ F t_0))))
       (/ F (* B t_0)))
      (/ x B)))))
double code(double F, double B, double x) {
	double t_0 = F + (0.5 * ((2.0 + (x * 2.0)) / F));
	double tmp;
	if ((B <= -0.0028) || !(B <= 1.95e-11)) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else {
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_0)))) + (F / (B * t_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) :: t_0
    real(8) :: tmp
    t_0 = f + (0.5d0 * ((2.0d0 + (x * 2.0d0)) / f))
    if ((b <= (-0.0028d0)) .or. (.not. (b <= 1.95d-11))) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else
        tmp = ((b * ((x * 0.3333333333333333d0) - ((-0.16666666666666666d0) * (f / t_0)))) + (f / (b * t_0))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = F + (0.5 * ((2.0 + (x * 2.0)) / F));
	double tmp;
	if ((B <= -0.0028) || !(B <= 1.95e-11)) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_0)))) + (F / (B * t_0))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = F + (0.5 * ((2.0 + (x * 2.0)) / F))
	tmp = 0
	if (B <= -0.0028) or not (B <= 1.95e-11):
		tmp = (-1.0 / B) - (x / math.tan(B))
	else:
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_0)))) + (F / (B * t_0))) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(F + Float64(0.5 * Float64(Float64(2.0 + Float64(x * 2.0)) / F)))
	tmp = 0.0
	if ((B <= -0.0028) || !(B <= 1.95e-11))
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - Float64(-0.16666666666666666 * Float64(F / t_0)))) + Float64(F / Float64(B * t_0))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = F + (0.5 * ((2.0 + (x * 2.0)) / F));
	tmp = 0.0;
	if ((B <= -0.0028) || ~((B <= 1.95e-11)))
		tmp = (-1.0 / B) - (x / tan(B));
	else
		tmp = ((B * ((x * 0.3333333333333333) - (-0.16666666666666666 * (F / t_0)))) + (F / (B * t_0))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(F + N[(0.5 * N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[B, -0.0028], N[Not[LessEqual[B, 1.95e-11]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - N[(-0.16666666666666666 * N[(F / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(B * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\\
\mathbf{if}\;B \leq -0.0028 \lor \neg \left(B \leq 1.95 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\left(B \cdot \left(x \cdot 0.3333333333333333 - -0.16666666666666666 \cdot \frac{F}{t_0}\right) + \frac{F}{B \cdot t_0}\right) - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < -0.00279999999999999997 or 1.95000000000000005e-11 < B

    1. Initial program 88.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-in88.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. +-commutative88.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-inv88.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. Simplified88.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 51.7%

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

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

    if -0.00279999999999999997 < B < 1.95000000000000005e-11

    1. Initial program 77.3%

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

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

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

        \[\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. Simplified89.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. Step-by-step derivation
      1. clear-num89.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      4. div-inv60.1%

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      5. pow-flip60.1%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
      7. pow1/260.1%

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 69.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -0.0028 \lor \neg \left(B \leq 1.95 \cdot 10^{-11}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(B \cdot \left(x \cdot 0.3333333333333333 - -0.16666666666666666 \cdot \frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}\right) + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\right) - \frac{x}{B}\\ \end{array} \]

Alternative 19: 36.5% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \frac{\frac{F}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - x}{B} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (/ (- (/ F (+ F (/ (* 0.5 (+ 2.0 (* x 2.0))) F))) x) B))
double code(double F, double B, double x) {
	return ((F / (F + ((0.5 * (2.0 + (x * 2.0))) / F))) - 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 = ((f / (f + ((0.5d0 * (2.0d0 + (x * 2.0d0))) / f))) - x) / b
end function
public static double code(double F, double B, double x) {
	return ((F / (F + ((0.5 * (2.0 + (x * 2.0))) / F))) - x) / B;
}
def code(F, B, x):
	return ((F / (F + ((0.5 * (2.0 + (x * 2.0))) / F))) - x) / B
function code(F, B, x)
	return Float64(Float64(Float64(F / Float64(F + Float64(Float64(0.5 * Float64(2.0 + Float64(x * 2.0))) / F))) - x) / B)
end
function tmp = code(F, B, x)
	tmp = ((F / (F + ((0.5 * (2.0 + (x * 2.0))) / F))) - x) / B;
end
code[F_, B_, x_] := N[(N[(N[(F / N[(F + N[(N[(0.5 * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{F}{F + \frac{0.5 \cdot \left(2 + x \cdot 2\right)}{F}} - x}{B}
\end{array}
Derivation
  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. Simplified88.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. Step-by-step derivation
    1. clear-num88.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
    4. div-inv63.1%

      \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}\right)} - 1\right) - \frac{x}{\tan B} \]
    5. pow-flip63.1%

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

      \[\leadsto \left(e^{\mathsf{log1p}\left(\frac{F}{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}\right)} - 1\right) - \frac{x}{\tan B} \]
    7. pow1/263.1%

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

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

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

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

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

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

    \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}}} - \frac{x}{\tan B} \]
  13. Taylor expanded in B around 0 37.1%

    \[\leadsto \color{blue}{\frac{\frac{F}{F + 0.5 \cdot \frac{2 + 2 \cdot x}{F}} - x}{B}} \]
  14. Step-by-step derivation
    1. associate-*r/37.1%

      \[\leadsto \frac{\frac{F}{F + \color{blue}{\frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}}} - x}{B} \]
  15. Simplified37.1%

    \[\leadsto \color{blue}{\frac{\frac{F}{F + \frac{0.5 \cdot \left(2 + 2 \cdot x\right)}{F}} - x}{B}} \]
  16. Final simplification37.1%

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

Alternative 20: 30.0% accurate, 36.0× speedup?

\[\begin{array}{l} \\ 0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (- (* 0.3333333333333333 (* B x)) (/ x B)))
double code(double F, double B, double x) {
	return (0.3333333333333333 * (B * x)) - (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 = (0.3333333333333333d0 * (b * x)) - (x / b)
end function
public static double code(double F, double B, double x) {
	return (0.3333333333333333 * (B * x)) - (x / B);
}
def code(F, B, x):
	return (0.3333333333333333 * (B * x)) - (x / B)
function code(F, B, x)
	return Float64(Float64(0.3333333333333333 * Float64(B * x)) - Float64(x / B))
end
function tmp = code(F, B, x)
	tmp = (0.3333333333333333 * (B * x)) - (x / B);
end
code[F_, B_, x_] := N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}
\end{array}
Derivation
  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. fma-def82.7%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
    11. *-rgt-identity82.8%

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

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

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

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

      \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
    3. *-commutative58.7%

      \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    4. distribute-rgt-neg-in58.7%

      \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
  6. Simplified58.7%

    \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
  7. Step-by-step derivation
    1. clear-num58.6%

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

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

    \[\leadsto \cos B \cdot \left(-\color{blue}{{\left(\frac{\sin B}{x}\right)}^{-1}}\right) \]
  9. Step-by-step derivation
    1. unpow-158.6%

      \[\leadsto \cos B \cdot \left(-\color{blue}{\frac{1}{\frac{\sin B}{x}}}\right) \]
  10. Simplified58.6%

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

    \[\leadsto \color{blue}{-1 \cdot \left(B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)\right) + -1 \cdot \frac{x}{B}} \]
  12. Step-by-step derivation
    1. mul-1-neg31.6%

      \[\leadsto -1 \cdot \left(B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)\right) + \color{blue}{\left(-\frac{x}{B}\right)} \]
    2. unsub-neg31.6%

      \[\leadsto \color{blue}{-1 \cdot \left(B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)\right) - \frac{x}{B}} \]
    3. distribute-rgt-out--31.6%

      \[\leadsto -1 \cdot \left(B \cdot \color{blue}{\left(x \cdot \left(-0.5 - -0.16666666666666666\right)\right)}\right) - \frac{x}{B} \]
    4. metadata-eval31.6%

      \[\leadsto -1 \cdot \left(B \cdot \left(x \cdot \color{blue}{-0.3333333333333333}\right)\right) - \frac{x}{B} \]
    5. associate-*r*31.6%

      \[\leadsto -1 \cdot \color{blue}{\left(\left(B \cdot x\right) \cdot -0.3333333333333333\right)} - \frac{x}{B} \]
    6. *-commutative31.6%

      \[\leadsto -1 \cdot \color{blue}{\left(-0.3333333333333333 \cdot \left(B \cdot x\right)\right)} - \frac{x}{B} \]
    7. associate-*r*31.6%

      \[\leadsto \color{blue}{\left(-1 \cdot -0.3333333333333333\right) \cdot \left(B \cdot x\right)} - \frac{x}{B} \]
    8. metadata-eval31.6%

      \[\leadsto \color{blue}{0.3333333333333333} \cdot \left(B \cdot x\right) - \frac{x}{B} \]
  13. Simplified31.6%

    \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}} \]
  14. Final simplification31.6%

    \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B} \]

Alternative 21: 29.7% 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 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. fma-def82.7%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
    11. *-rgt-identity82.8%

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

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

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

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

      \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
    3. *-commutative58.7%

      \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    4. distribute-rgt-neg-in58.7%

      \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
  6. Simplified58.7%

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
    2. neg-mul-131.5%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  9. Simplified31.5%

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  10. Final simplification31.5%

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

Reproduce

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