VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.6%
Time: 19.9s
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: 76.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 68.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified77.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-num77.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-pow77.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-def77.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-udef77.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. *-commutative77.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-def77.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-def77.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-rr77.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-177.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} \]
      2. fma-udef77.4%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 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 -3.1e14 < F < 7.5e7

    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 7.5e7 < F

    1. Initial program 56.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative56.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg56.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. associate-*l/70.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      2. fma-udef70.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{F}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)} - \frac{x}{\tan B} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (- (/ F (* (sin B) (hypot F (sqrt 2.0)))) (/ x (tan B))))
double code(double F, double B, double x) {
	return (F / (sin(B) * hypot(F, sqrt(2.0)))) - (x / tan(B));
}
public static double code(double F, double B, double x) {
	return (F / (Math.sin(B) * Math.hypot(F, Math.sqrt(2.0)))) - (x / Math.tan(B));
}
def code(F, B, x):
	return (F / (math.sin(B) * math.hypot(F, math.sqrt(2.0)))) - (x / math.tan(B))
function code(F, B, x)
	return Float64(Float64(F / Float64(sin(B) * hypot(F, sqrt(2.0)))) - Float64(x / tan(B)))
end
function tmp = code(F, B, x)
	tmp = (F / (sin(B) * hypot(F, sqrt(2.0)))) - (x / tan(B));
end
code[F_, B_, x_] := N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[F ^ 2 + N[Sqrt[2.0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{F}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)} - \frac{x}{\tan B}
\end{array}
Derivation
  1. Initial program 78.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. +-commutative78.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 \cdot \frac{1}{\tan B}\right)} \]
    2. unsub-neg78.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. associate-*l/85.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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} \]
    2. fma-udef85.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{F}{\color{blue}{\sin B \cdot \mathsf{hypot}\left(F, \sqrt{2}\right)}} - \frac{x}{\tan B} \]
  13. Final simplification99.6%

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 67.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. +-commutative67.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg67.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. associate-*l/76.6%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified76.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-num76.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-pow76.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-def76.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-udef76.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. *-commutative76.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-def76.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-def76.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-rr76.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-176.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} \]
      2. fma-udef76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4e18 < F < 9.2e7

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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. associate-*l/99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 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(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. Taylor expanded in x around 0 99.5%

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

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

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

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

    if 9.2e7 < F

    1. Initial program 56.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative56.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg56.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. associate-*l/70.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      2. fma-udef70.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 92000000:\\ \;\;\;\;F \cdot \frac{1}{\sin B \cdot \sqrt{2 + F \cdot F}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 4: 99.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - 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.3999999999999999

    1. Initial program 70.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. +-commutative70.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg70.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. associate-*l/78.5%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified78.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-num78.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-pow78.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-def78.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-udef78.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. *-commutative78.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-def78.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-def78.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-rr78.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-178.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} \]
      2. fma-udef78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.4199999999999999

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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. associate-*l/99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 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(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. un-div-inv99.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{F}{\sin B \cdot \sqrt{F \cdot F + \color{blue}{\sqrt{2} \cdot \sqrt{2}}}} - \frac{x}{\tan B} \]
      4. hypot-def99.5%

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

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

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

    if 1.4199999999999999 < F

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative56.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg56.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. associate-*l/71.2%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified71.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. Step-by-step derivation
      1. clear-num71.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-pow71.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-def71.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-udef71.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. *-commutative71.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-def71.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-def71.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-rr71.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-171.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} \]
      2. fma-udef71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.42:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 5: 92.6% accurate, 1.4× speedup?

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

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

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

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

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


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

    1. Initial program 70.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. +-commutative70.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg70.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. associate-*l/78.8%

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Step-by-step derivation
      1. clear-num78.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-pow78.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-def78.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-udef78.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. *-commutative78.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-def78.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-def78.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-rr78.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-178.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} \]
      2. fma-udef78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0389999999999999999 < F < 1.75e-100

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

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

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

    if 1.75e-100 < F < 49000

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

      \[\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 49000 < F

    1. Initial program 56.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative56.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg56.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. associate-*l/70.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      2. fma-udef70.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 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 4 regimes into one program.
  4. Final simplification93.6%

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

Alternative 6: 92.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.06 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t_0 \cdot \frac{F}{B}\\

\mathbf{elif}\;F \leq 1560000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\

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


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

    1. Initial program 70.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. +-commutative70.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg70.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. associate-*l/78.8%

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Step-by-step derivation
      1. clear-num78.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-pow78.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-def78.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-udef78.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. *-commutative78.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-def78.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-def78.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-rr78.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-178.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} \]
      2. fma-udef78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.10000000000000001 < F < 1.0600000000000001e-100

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

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

    if 1.0600000000000001e-100 < F < 1.56e6

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

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

    if 1.56e6 < F

    1. Initial program 56.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative56.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg56.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. associate-*l/70.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      2. fma-udef70.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 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 4 regimes into one program.
  4. Final simplification93.6%

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

Alternative 7: 91.8% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 70.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. +-commutative70.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg70.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. associate-*l/78.8%

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Step-by-step derivation
      1. clear-num78.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-pow78.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-def78.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-udef78.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. *-commutative78.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-def78.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-def78.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-rr78.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-178.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} \]
      2. fma-udef78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.045999999999999999 < F < 1.8999999999999999e-18

    1. Initial program 99.6%

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

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

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

    if 1.8999999999999999e-18 < F

    1. Initial program 58.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. +-commutative58.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg58.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. associate-*l/71.9%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified71.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-num71.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-pow71.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-def71.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-udef71.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. *-commutative71.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-def71.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-def71.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-rr71.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-171.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} \]
      2. fma-udef71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.046:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-18}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 8: 70.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -2.7 \cdot 10^{+185}:\\ \;\;\;\;\frac{-1}{B} - t_0\\ \mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2800:\\ \;\;\;\;x \cdot \frac{-\cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* x (/ 1.0 (tan B)))))
   (if (<= F -2.7e+185)
     (- (/ -1.0 B) t_0)
     (if (<= F -9e-38)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 2800.0) (* x (/ (- (cos B)) (sin B))) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x * (1.0 / tan(B));
	double tmp;
	if (F <= -2.7e+185) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -9e-38) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 2800.0) {
		tmp = x * (-cos(B) / sin(B));
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x * (1.0d0 / tan(b))
    if (f <= (-2.7d+185)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-9d-38)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 2800.0d0) then
        tmp = x * (-cos(b) / sin(b))
    else
        tmp = (1.0d0 / b) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x * (1.0 / Math.tan(B));
	double tmp;
	if (F <= -2.7e+185) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -9e-38) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 2800.0) {
		tmp = x * (-Math.cos(B) / Math.sin(B));
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x * (1.0 / math.tan(B))
	tmp = 0
	if F <= -2.7e+185:
		tmp = (-1.0 / B) - t_0
	elif F <= -9e-38:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 2800.0:
		tmp = x * (-math.cos(B) / math.sin(B))
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x * Float64(1.0 / tan(B)))
	tmp = 0.0
	if (F <= -2.7e+185)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -9e-38)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 2800.0)
		tmp = Float64(x * Float64(Float64(-cos(B)) / sin(B)));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x * (1.0 / tan(B));
	tmp = 0.0;
	if (F <= -2.7e+185)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -9e-38)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 2800.0)
		tmp = x * (-cos(B) / sin(B));
	else
		tmp = (1.0 / B) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.7e+185], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -9e-38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800.0], N[(x * N[((-N[Cos[B], $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;x \cdot \frac{-\cos B}{\sin B}\\

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


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

    1. Initial program 50.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 75.3%

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

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

    if -2.70000000000000007e185 < F < -9.00000000000000018e-38

    1. Initial program 79.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 82.5%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} - \frac{1}{\sin B} \]
    6. Simplified77.8%

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

    if -9.00000000000000018e-38 < F < 2800

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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. associate-*l/99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 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(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. un-div-inv99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. associate-/r/70.7%

        \[\leadsto -\color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      4. distribute-rgt-neg-in70.7%

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

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

    if 2800 < F

    1. Initial program 56.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+185}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2800:\\ \;\;\;\;x \cdot \frac{-\cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 9: 70.9% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 50.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 75.3%

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

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

    if -2.79999999999999989e187 < F < -9.00000000000000018e-38

    1. Initial program 79.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 82.5%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} - \frac{1}{\sin B} \]
    6. Simplified77.8%

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

    if -9.00000000000000018e-38 < F < 2800

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. 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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. 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)}, -x \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)}^{\color{blue}{-0.5}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in99.5%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/99.6%

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

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

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

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

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

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

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

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

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

    if 2800 < F

    1. Initial program 56.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.8 \cdot 10^{+187}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2800:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 10: 84.9% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 71.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. +-commutative71.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg71.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. associate-*l/79.8%

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Step-by-step derivation
      1. clear-num79.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-pow79.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-def79.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-udef79.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. *-commutative79.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-def79.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-def79.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-rr79.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-179.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} \]
      2. fma-udef79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25000000000000012e-43 < F < 5.79999999999999978e-30

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. fma-def99.6%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-commutative99.6%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutative99.6%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. fma-def99.6%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.6%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. metadata-eval99.6%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.6%

        \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in99.6%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/99.6%

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

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

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

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

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

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

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

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

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

    if 5.79999999999999978e-30 < F

    1. Initial program 58.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. +-commutative58.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg58.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. associate-*l/71.9%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified71.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-num71.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-pow71.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-def71.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-udef71.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. *-commutative71.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-def71.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-def71.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-rr71.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-171.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} \]
      2. fma-udef71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 77.7% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 71.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. +-commutative71.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg71.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. associate-*l/79.8%

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

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

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Step-by-step derivation
      1. clear-num79.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-pow79.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-def79.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-udef79.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. *-commutative79.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-def79.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-def79.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-rr79.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-179.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} \]
      2. fma-udef79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999966e-38 < F < 2800

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. 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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. 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)}, -x \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)}^{\color{blue}{-0.5}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in99.5%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/99.6%

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

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

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

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

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

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

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

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

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

    if 2800 < F

    1. Initial program 56.3%

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

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

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

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

Alternative 12: 64.7% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{+187}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

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

\mathbf{elif}\;F \leq 1.9 \cdot 10^{-18} \lor \neg \left(F \leq 1.26 \cdot 10^{+151}\right) \land F \leq 5.8 \cdot 10^{+177}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 50.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 75.3%

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

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

    if -4.2e187 < F < -9.00000000000000018e-38

    1. Initial program 79.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 82.5%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} - \frac{1}{\sin B} \]
    6. Simplified77.8%

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

    if -9.00000000000000018e-38 < F < 1.8999999999999999e-18 or 1.26000000000000006e151 < F < 5.80000000000000027e177

    1. Initial program 97.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. +-commutative97.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg97.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. associate-*l/97.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      2. fma-udef97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. associate-/r/73.0%

        \[\leadsto -\color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      4. distribute-rgt-neg-in73.0%

        \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    12. Simplified73.0%

      \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    13. Step-by-step derivation
      1. *-commutative73.0%

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

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      3. sqrt-unprod10.1%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      4. sqr-neg10.1%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      5. sqrt-unprod1.0%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      6. add-sqr-sqrt2.2%

        \[\leadsto \color{blue}{x} \cdot \frac{\cos B}{\sin B} \]
      7. clear-num2.2%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      8. tan-quot2.2%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      9. div-inv2.2%

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      10. frac-2neg2.2%

        \[\leadsto \color{blue}{\frac{-x}{-\tan B}} \]
      11. neg-sub02.2%

        \[\leadsto \frac{\color{blue}{0 - x}}{-\tan B} \]
      12. metadata-eval2.2%

        \[\leadsto \frac{\color{blue}{\log 1} - x}{-\tan B} \]
      13. div-sub2.2%

        \[\leadsto \color{blue}{\frac{\log 1}{-\tan B} - \frac{x}{-\tan B}} \]
      14. metadata-eval2.2%

        \[\leadsto \frac{\color{blue}{0}}{-\tan B} - \frac{x}{-\tan B} \]
      15. add-sqr-sqrt1.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      16. sqrt-unprod10.2%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      17. sqr-neg10.2%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      18. sqrt-unprod14.2%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      19. add-sqr-sqrt73.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{-x}}{-\tan B} \]
      20. frac-2neg73.0%

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    14. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{\tan B}} \]
    15. Step-by-step derivation
      1. div073.0%

        \[\leadsto \color{blue}{0} - \frac{x}{\tan B} \]
      2. neg-sub073.0%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      3. distribute-neg-frac73.0%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    16. Simplified73.0%

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

    if 1.8999999999999999e-18 < F < 1.26000000000000006e151 or 5.80000000000000027e177 < F

    1. Initial program 55.4%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F} \]
    4. Step-by-step derivation
      1. expm1-log1p-u9.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F}\right)\right)} \]
      2. expm1-udef9.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F}\right)} - 1} \]
    5. Applied egg-rr31.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x}{B} + \frac{F}{F \cdot \sin B}\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def32.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{B} + \frac{F}{F \cdot \sin B}\right)\right)} \]
      2. expm1-log1p60.1%

        \[\leadsto \color{blue}{\frac{x}{B} + \frac{F}{F \cdot \sin B}} \]
      3. +-commutative60.1%

        \[\leadsto \color{blue}{\frac{F}{F \cdot \sin B} + \frac{x}{B}} \]
      4. associate-/r*60.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{F}}{\sin B}} + \frac{x}{B} \]
      5. *-inverses60.3%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} + \frac{x}{B} \]
    7. Simplified60.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{+187}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-18} \lor \neg \left(F \leq 1.26 \cdot 10^{+151}\right) \land F \leq 5.8 \cdot 10^{+177}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\ \end{array} \]

Alternative 13: 58.8% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-93} \lor \neg \left(x \leq 9.5 \cdot 10^{-206} \lor \neg \left(x \leq 1.25 \cdot 10^{-61}\right) \land x \leq 2.2 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3500000000000001e-93 or 9.49999999999999979e-206 < x < 1.25e-61 or 2.2000000000000001e-14 < x

    1. Initial program 87.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. +-commutative87.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg87.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. associate-*l/95.4%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified95.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. Step-by-step derivation
      1. clear-num95.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-pow95.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-def95.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-udef95.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. *-commutative95.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-def95.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-def95.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-rr95.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-195.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} \]
      2. fma-udef95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. associate-/r/79.3%

        \[\leadsto -\color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      4. distribute-rgt-neg-in79.3%

        \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    12. Simplified79.3%

      \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    13. Step-by-step derivation
      1. *-commutative79.3%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
      2. add-sqr-sqrt23.0%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      3. sqrt-unprod17.6%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      4. sqr-neg17.6%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      5. sqrt-unprod0.9%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      6. add-sqr-sqrt1.4%

        \[\leadsto \color{blue}{x} \cdot \frac{\cos B}{\sin B} \]
      7. clear-num1.4%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      8. tan-quot1.4%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      9. div-inv1.4%

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      10. frac-2neg1.4%

        \[\leadsto \color{blue}{\frac{-x}{-\tan B}} \]
      11. neg-sub01.4%

        \[\leadsto \frac{\color{blue}{0 - x}}{-\tan B} \]
      12. metadata-eval1.4%

        \[\leadsto \frac{\color{blue}{\log 1} - x}{-\tan B} \]
      13. div-sub1.4%

        \[\leadsto \color{blue}{\frac{\log 1}{-\tan B} - \frac{x}{-\tan B}} \]
      14. metadata-eval1.4%

        \[\leadsto \frac{\color{blue}{0}}{-\tan B} - \frac{x}{-\tan B} \]
      15. add-sqr-sqrt0.9%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      16. sqrt-unprod17.7%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      17. sqr-neg17.7%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      18. sqrt-unprod23.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      19. add-sqr-sqrt79.4%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{-x}}{-\tan B} \]
      20. frac-2neg79.4%

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    14. Applied egg-rr79.4%

      \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{\tan B}} \]
    15. Step-by-step derivation
      1. div079.4%

        \[\leadsto \color{blue}{0} - \frac{x}{\tan B} \]
      2. neg-sub079.4%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      3. distribute-neg-frac79.4%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    16. Simplified79.4%

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

    if -1.3500000000000001e-93 < x < 9.49999999999999979e-206 or 1.25e-61 < x < 2.2000000000000001e-14

    1. Initial program 62.9%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F} \]
    4. Step-by-step derivation
      1. expm1-log1p-u4.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F}\right)\right)} \]
      2. expm1-udef4.7%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x}{B} + \frac{F}{F \cdot \sin B}\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def18.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{B} + \frac{F}{F \cdot \sin B}\right)\right)} \]
      2. expm1-log1p38.6%

        \[\leadsto \color{blue}{\frac{x}{B} + \frac{F}{F \cdot \sin B}} \]
      3. +-commutative38.6%

        \[\leadsto \color{blue}{\frac{F}{F \cdot \sin B} + \frac{x}{B}} \]
      4. associate-/r*38.7%

        \[\leadsto \color{blue}{\frac{\frac{F}{F}}{\sin B}} + \frac{x}{B} \]
      5. *-inverses38.7%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} + \frac{x}{B} \]
    7. Simplified38.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{-93} \lor \neg \left(x \leq 9.5 \cdot 10^{-206} \lor \neg \left(x \leq 1.25 \cdot 10^{-61}\right) \land x \leq 2.2 \cdot 10^{-14}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\ \end{array} \]

Alternative 14: 64.8% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq 1.9 \cdot 10^{-18} \lor \neg \left(F \leq 5.8 \cdot 10^{+153}\right) \land F \leq 8.5 \cdot 10^{+176}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} - \frac{1}{\sin B} \]
    6. Simplified71.7%

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

    if -9.00000000000000018e-38 < F < 1.8999999999999999e-18 or 5.80000000000000004e153 < F < 8.4999999999999995e176

    1. Initial program 97.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. +-commutative97.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg97.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. associate-*l/97.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      2. fma-udef97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. associate-/r/73.0%

        \[\leadsto -\color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      4. distribute-rgt-neg-in73.0%

        \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    12. Simplified73.0%

      \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    13. Step-by-step derivation
      1. *-commutative73.0%

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

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      3. sqrt-unprod10.1%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      4. sqr-neg10.1%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      5. sqrt-unprod1.0%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      6. add-sqr-sqrt2.2%

        \[\leadsto \color{blue}{x} \cdot \frac{\cos B}{\sin B} \]
      7. clear-num2.2%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      8. tan-quot2.2%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      9. div-inv2.2%

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      10. frac-2neg2.2%

        \[\leadsto \color{blue}{\frac{-x}{-\tan B}} \]
      11. neg-sub02.2%

        \[\leadsto \frac{\color{blue}{0 - x}}{-\tan B} \]
      12. metadata-eval2.2%

        \[\leadsto \frac{\color{blue}{\log 1} - x}{-\tan B} \]
      13. div-sub2.2%

        \[\leadsto \color{blue}{\frac{\log 1}{-\tan B} - \frac{x}{-\tan B}} \]
      14. metadata-eval2.2%

        \[\leadsto \frac{\color{blue}{0}}{-\tan B} - \frac{x}{-\tan B} \]
      15. add-sqr-sqrt1.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      16. sqrt-unprod10.2%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      17. sqr-neg10.2%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      18. sqrt-unprod14.2%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      19. add-sqr-sqrt73.0%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{-x}}{-\tan B} \]
      20. frac-2neg73.0%

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    14. Applied egg-rr73.0%

      \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{\tan B}} \]
    15. Step-by-step derivation
      1. div073.0%

        \[\leadsto \color{blue}{0} - \frac{x}{\tan B} \]
      2. neg-sub073.0%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      3. distribute-neg-frac73.0%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    16. Simplified73.0%

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

    if 1.8999999999999999e-18 < F < 5.80000000000000004e153 or 8.4999999999999995e176 < F

    1. Initial program 55.4%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F} \]
    4. Step-by-step derivation
      1. expm1-log1p-u9.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F}\right)\right)} \]
      2. expm1-udef9.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F}\right)} - 1} \]
    5. Applied egg-rr31.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x}{B} + \frac{F}{F \cdot \sin B}\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def32.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{B} + \frac{F}{F \cdot \sin B}\right)\right)} \]
      2. expm1-log1p60.1%

        \[\leadsto \color{blue}{\frac{x}{B} + \frac{F}{F \cdot \sin B}} \]
      3. +-commutative60.1%

        \[\leadsto \color{blue}{\frac{F}{F \cdot \sin B} + \frac{x}{B}} \]
      4. associate-/r*60.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{F}}{\sin B}} + \frac{x}{B} \]
      5. *-inverses60.3%

        \[\leadsto \frac{\color{blue}{1}}{\sin B} + \frac{x}{B} \]
    7. Simplified60.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-18} \lor \neg \left(F \leq 5.8 \cdot 10^{+153}\right) \land F \leq 8.5 \cdot 10^{+176}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\ \end{array} \]

Alternative 15: 70.9% accurate, 2.8× speedup?

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

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

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

\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 50.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 75.3%

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

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

    if -1.35000000000000004e187 < F < -9.00000000000000018e-38

    1. Initial program 79.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 82.5%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} - \frac{1}{\sin B} \]
    6. Simplified77.8%

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

    if -9.00000000000000018e-38 < F < 2800

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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. associate-*l/99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 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(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. un-div-inv99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. associate-/r/70.7%

        \[\leadsto -\color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      4. distribute-rgt-neg-in70.7%

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

      \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    13. Step-by-step derivation
      1. *-commutative70.7%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
      2. add-sqr-sqrt11.3%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      3. sqrt-unprod9.6%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      4. sqr-neg9.6%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      5. sqrt-unprod1.1%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      6. add-sqr-sqrt2.3%

        \[\leadsto \color{blue}{x} \cdot \frac{\cos B}{\sin B} \]
      7. clear-num2.3%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      8. tan-quot2.3%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      9. div-inv2.3%

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      10. frac-2neg2.3%

        \[\leadsto \color{blue}{\frac{-x}{-\tan B}} \]
      11. neg-sub02.3%

        \[\leadsto \frac{\color{blue}{0 - x}}{-\tan B} \]
      12. metadata-eval2.3%

        \[\leadsto \frac{\color{blue}{\log 1} - x}{-\tan B} \]
      13. div-sub2.3%

        \[\leadsto \color{blue}{\frac{\log 1}{-\tan B} - \frac{x}{-\tan B}} \]
      14. metadata-eval2.3%

        \[\leadsto \frac{\color{blue}{0}}{-\tan B} - \frac{x}{-\tan B} \]
      15. add-sqr-sqrt1.1%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      16. sqrt-unprod9.7%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      17. sqr-neg9.7%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      18. sqrt-unprod11.3%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      19. add-sqr-sqrt70.7%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{-x}}{-\tan B} \]
      20. frac-2neg70.7%

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    14. Applied egg-rr70.7%

      \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{\tan B}} \]
    15. Step-by-step derivation
      1. div070.7%

        \[\leadsto \color{blue}{0} - \frac{x}{\tan B} \]
      2. neg-sub070.7%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      3. distribute-neg-frac70.7%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    16. Simplified70.7%

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

    if 2800 < F

    1. Initial program 56.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{+187}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -9 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2800:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 16: 56.0% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq -5.4 \cdot 10^{-69} \lor \neg \left(B \leq 1.02 \cdot 10^{-122}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < -5.3999999999999995e-69 or 1.02000000000000002e-122 < B

    1. Initial program 83.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. +-commutative83.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 \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg83.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. associate-*l/84.1%

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified84.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-num84.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-pow84.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-def84.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-udef84.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. *-commutative84.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-def84.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-def84.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-rr84.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-184.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} \]
      2. fma-udef84.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. associate-/r/55.4%

        \[\leadsto -\color{blue}{\frac{\cos B}{\sin B} \cdot x} \]
      4. distribute-rgt-neg-in55.4%

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

      \[\leadsto \color{blue}{\frac{\cos B}{\sin B} \cdot \left(-x\right)} \]
    13. Step-by-step derivation
      1. *-commutative55.4%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{\cos B}{\sin B}} \]
      2. add-sqr-sqrt18.4%

        \[\leadsto \color{blue}{\left(\sqrt{-x} \cdot \sqrt{-x}\right)} \cdot \frac{\cos B}{\sin B} \]
      3. sqrt-unprod12.8%

        \[\leadsto \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\cos B}{\sin B} \]
      4. sqr-neg12.8%

        \[\leadsto \sqrt{\color{blue}{x \cdot x}} \cdot \frac{\cos B}{\sin B} \]
      5. sqrt-unprod1.2%

        \[\leadsto \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)} \cdot \frac{\cos B}{\sin B} \]
      6. add-sqr-sqrt2.6%

        \[\leadsto \color{blue}{x} \cdot \frac{\cos B}{\sin B} \]
      7. clear-num2.6%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \]
      8. tan-quot2.6%

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      9. div-inv2.6%

        \[\leadsto \color{blue}{\frac{x}{\tan B}} \]
      10. frac-2neg2.6%

        \[\leadsto \color{blue}{\frac{-x}{-\tan B}} \]
      11. neg-sub02.6%

        \[\leadsto \frac{\color{blue}{0 - x}}{-\tan B} \]
      12. metadata-eval2.6%

        \[\leadsto \frac{\color{blue}{\log 1} - x}{-\tan B} \]
      13. div-sub2.6%

        \[\leadsto \color{blue}{\frac{\log 1}{-\tan B} - \frac{x}{-\tan B}} \]
      14. metadata-eval2.6%

        \[\leadsto \frac{\color{blue}{0}}{-\tan B} - \frac{x}{-\tan B} \]
      15. add-sqr-sqrt1.2%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{-\tan B} \]
      16. sqrt-unprod12.8%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{x \cdot x}}}{-\tan B} \]
      17. sqr-neg12.8%

        \[\leadsto \frac{0}{-\tan B} - \frac{\sqrt{\color{blue}{\left(-x\right) \cdot \left(-x\right)}}}{-\tan B} \]
      18. sqrt-unprod18.4%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{-\tan B} \]
      19. add-sqr-sqrt55.4%

        \[\leadsto \frac{0}{-\tan B} - \frac{\color{blue}{-x}}{-\tan B} \]
      20. frac-2neg55.4%

        \[\leadsto \frac{0}{-\tan B} - \color{blue}{\frac{x}{\tan B}} \]
    14. Applied egg-rr55.4%

      \[\leadsto \color{blue}{\frac{0}{-\tan B} - \frac{x}{\tan B}} \]
    15. Step-by-step derivation
      1. div055.4%

        \[\leadsto \color{blue}{0} - \frac{x}{\tan B} \]
      2. neg-sub055.4%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      3. distribute-neg-frac55.4%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    16. Simplified55.4%

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

    if -5.3999999999999995e-69 < B < 1.02000000000000002e-122

    1. Initial program 67.9%

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

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

        \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-commutative67.9%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutative67.9%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. fma-def67.9%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. fma-def67.9%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. metadata-eval67.9%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval67.9%

        \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in67.9%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/67.9%

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

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

      \[\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 B around 0 87.7%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(1 + x\right)}}{B} \]
    8. Step-by-step derivation
      1. distribute-lft-in66.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      2. metadata-eval66.1%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      3. mul-1-neg66.1%

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

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    9. Simplified66.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -5.4 \cdot 10^{-69} \lor \neg \left(B \leq 1.02 \cdot 10^{-122}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \]

Alternative 17: 44.3% accurate, 29.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-91}:\\ \;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-30}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9.5e-91)
   (- (* B -0.16666666666666666) (/ (+ x 1.0) B))
   (if (<= F 8.2e-30) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-91) {
		tmp = (B * -0.16666666666666666) - ((x + 1.0) / B);
	} else if (F <= 8.2e-30) {
		tmp = -(x / B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-9.5d-91)) then
        tmp = (b * (-0.16666666666666666d0)) - ((x + 1.0d0) / b)
    else if (f <= 8.2d-30) then
        tmp = -(x / b)
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.5e-91) {
		tmp = (B * -0.16666666666666666) - ((x + 1.0) / B);
	} else if (F <= 8.2e-30) {
		tmp = -(x / B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -9.5e-91:
		tmp = (B * -0.16666666666666666) - ((x + 1.0) / B)
	elif F <= 8.2e-30:
		tmp = -(x / B)
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -9.5e-91)
		tmp = Float64(Float64(B * -0.16666666666666666) - Float64(Float64(x + 1.0) / B));
	elseif (F <= 8.2e-30)
		tmp = Float64(-Float64(x / B));
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -9.5e-91)
		tmp = (B * -0.16666666666666666) - ((x + 1.0) / B);
	elseif (F <= 8.2e-30)
		tmp = -(x / B);
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-91], N[(N[(B * -0.16666666666666666), $MachinePrecision] - N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.2e-30], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-91}:\\
\;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\

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

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


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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + -0.16666666666666666 \cdot B} \]
    5. Step-by-step derivation
      1. +-commutative45.9%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot B + -1 \cdot \frac{1 + x}{B}} \]
      2. *-commutative45.9%

        \[\leadsto \color{blue}{B \cdot -0.16666666666666666} + -1 \cdot \frac{1 + x}{B} \]
      3. mul-1-neg45.9%

        \[\leadsto B \cdot -0.16666666666666666 + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      4. unsub-neg45.9%

        \[\leadsto \color{blue}{B \cdot -0.16666666666666666 - \frac{1 + x}{B}} \]
    6. Simplified45.9%

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

    if -9.5e-91 < F < 8.2000000000000007e-30

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. 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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. 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)}, -x \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)}^{\color{blue}{-0.5}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in99.5%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/99.6%

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

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

      \[\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 B around 0 48.1%

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

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

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

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

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

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

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

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

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

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

    if 8.2000000000000007e-30 < F

    1. Initial program 58.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. +-commutative58.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 \cdot \frac{1}{\tan B}\right)} \]
      2. fma-def58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-commutative58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutative58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. fma-def58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. fma-def58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. metadata-eval58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval58.0%

        \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in58.0%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/58.1%

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

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

      \[\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 B around 0 31.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-91}:\\ \;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-30}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 18: 44.1% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.75 \cdot 10^{-109}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-33}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.75e-109)
   (/ (- -1.0 x) B)
   (if (<= F 4.2e-33) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.75e-109) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 4.2e-33) {
		tmp = -(x / B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.75d-109)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 4.2d-33) then
        tmp = -(x / b)
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.75e-109) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 4.2e-33) {
		tmp = -(x / B);
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.75e-109:
		tmp = (-1.0 - x) / B
	elif F <= 4.2e-33:
		tmp = -(x / B)
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.75e-109)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 4.2e-33)
		tmp = Float64(-Float64(x / B));
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.75e-109)
		tmp = (-1.0 - x) / B;
	elseif (F <= 4.2e-33)
		tmp = -(x / B);
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.75e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e-33], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 76.1%

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

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

        \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-commutative76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutative76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. fma-def76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. fma-def76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. metadata-eval76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval76.1%

        \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in76.1%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/76.2%

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

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

      \[\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 B around 0 42.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(1 + x\right)}}{B} \]
    8. Step-by-step derivation
      1. distribute-lft-in44.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      2. metadata-eval44.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      3. mul-1-neg44.5%

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

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    9. Simplified44.5%

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

    if -1.75e-109 < F < 4.2e-33

    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. +-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 \cdot \frac{1}{\tan B}\right)} \]
      2. 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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. 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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. 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)}, -x \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)}^{\color{blue}{-0.5}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in99.5%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/99.6%

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

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

      \[\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 B around 0 48.6%

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

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

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

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

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

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

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

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

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

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

    if 4.2e-33 < F

    1. Initial program 58.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. +-commutative58.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 \cdot \frac{1}{\tan B}\right)} \]
      2. fma-def58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-commutative58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutative58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. fma-def58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. fma-def58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. metadata-eval58.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval58.0%

        \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in58.0%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/58.1%

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

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

      \[\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 B around 0 31.0%

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

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

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

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

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

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

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

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

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

Alternative 19: 36.9% accurate, 45.9× speedup?

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

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

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


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

    1. Initial program 76.1%

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

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

        \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-commutative76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutative76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. fma-def76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. fma-def76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. metadata-eval76.1%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval76.1%

        \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in76.1%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/76.2%

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

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

      \[\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 B around 0 42.3%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(1 + x\right)}}{B} \]
    8. Step-by-step derivation
      1. distribute-lft-in44.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      2. metadata-eval44.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      3. mul-1-neg44.5%

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

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    9. Simplified44.5%

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

    if -1.75e-109 < F

    1. Initial program 80.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. +-commutative80.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 \cdot \frac{1}{\tan B}\right)} \]
      2. fma-def80.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. +-commutative80.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutative80.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      5. fma-def80.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      6. fma-def80.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      7. metadata-eval80.0%

        \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval80.0%

        \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
      9. distribute-lft-neg-in80.0%

        \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
      10. associate-*r/80.1%

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

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

      \[\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 B around 0 40.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 30.5% 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 78.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. +-commutative78.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 \cdot \frac{1}{\tan B}\right)} \]
    2. fma-def78.6%

      \[\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)}, -x \cdot \frac{1}{\tan B}\right)} \]
    3. +-commutative78.6%

      \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
    4. *-commutative78.6%

      \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
    5. fma-def78.6%

      \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
    6. fma-def78.6%

      \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
    7. metadata-eval78.6%

      \[\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)}, -x \cdot \frac{1}{\tan B}\right) \]
    8. metadata-eval78.6%

      \[\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}}, -x \cdot \frac{1}{\tan B}\right) \]
    9. distribute-lft-neg-in78.6%

      \[\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}{\left(-x\right) \cdot \frac{1}{\tan B}}\right) \]
    10. associate-*r/78.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-identity78.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. Simplified78.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)} \]
  4. Taylor expanded in B around 0 41.0%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  9. Simplified27.0%

    \[\leadsto \frac{\color{blue}{-x}}{B} \]
  10. Final simplification27.0%

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

Alternative 21: 2.9% accurate, 108.0× speedup?

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

\\
B \cdot -0.16666666666666666
\end{array}
Derivation
  1. Initial program 78.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 51.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 38.5%

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

    \[\leadsto \color{blue}{-0.16666666666666666 \cdot B} \]
  5. Step-by-step derivation
    1. *-commutative3.3%

      \[\leadsto \color{blue}{B \cdot -0.16666666666666666} \]
  6. Simplified3.3%

    \[\leadsto \color{blue}{B \cdot -0.16666666666666666} \]
  7. Final simplification3.3%

    \[\leadsto B \cdot -0.16666666666666666 \]

Reproduce

?
herbie shell --seed 2023213 
(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))))))