VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.4% → 99.7%
Time: 18.3s
Alternatives: 22
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 22 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.4% 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.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 56.8%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg56.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.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/79.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. *-commutative79.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. Simplified79.6%

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

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

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

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

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

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

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

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

    if -4.2e17 < F < 1.35e10

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

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

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

    if 1.35e10 < F

    1. Initial program 58.8%

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 34.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. +-commutative34.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-neg34.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/65.0%

        \[\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/65.0%

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

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

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

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

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

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

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

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

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

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

    if -3.9999999999999999e156 < F < 1.99999999999999996e109

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999996e109 < F

    1. Initial program 45.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 x around 0 45.4%

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 60.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. +-commutative60.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-neg60.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/81.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/81.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. *-commutative81.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. Simplified81.2%

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

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

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

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

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

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

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

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

    if -1.3e8 < F < 3.4e14

    1. Initial program 99.4%

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

    if 3.4e14 < F

    1. Initial program 57.7%

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

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

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

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 60.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. +-commutative60.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-neg60.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/81.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/81.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. *-commutative81.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. Simplified81.2%

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

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

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

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

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

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

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

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

    if -1.22e8 < F < 2.15e14

    1. Initial program 99.4%

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

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

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

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

    if 2.15e14 < F

    1. Initial program 57.7%

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

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

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

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

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

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

Alternative 5: 99.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 62.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. +-commutative62.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-neg62.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/82.0%

        \[\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/81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{F}{\color{blue}{\left(-F\right)} - \frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    11. Simplified98.9%

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

    if -0.900000000000000022 < F < 0.0539999999999999994

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{0.5}}{\sin B} \cdot \color{blue}{\left(\sqrt{F} \cdot \frac{\sqrt{F}}{1}\right)} - \frac{x}{\tan B} \]
      5. /-rgt-identity43.1%

        \[\leadsto \frac{\sqrt{0.5}}{\sin B} \cdot \left(\sqrt{F} \cdot \color{blue}{\sqrt{F}}\right) - \frac{x}{\tan B} \]
      6. rem-square-sqrt98.8%

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

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

    if 0.0539999999999999994 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/78.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/78.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. *-commutative78.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. Simplified78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.054:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\

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


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

    1. Initial program 60.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. +-commutative60.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-neg60.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/81.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/81.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. *-commutative81.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. Simplified81.2%

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

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

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

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

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

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

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

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

    if -1.25e7 < F < -2.6e-28

    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 -2.6e-28 < F < 0.0539999999999999994

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity87.9%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      3. unpow287.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      4. fma-udef87.9%

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      8. rem-sqrt-square87.9%

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

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

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt87.9%

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

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

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

    if 0.0539999999999999994 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/78.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/78.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. *-commutative78.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. Simplified78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 91.7% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 0.054:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\

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


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

    1. Initial program 62.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. +-commutative62.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-neg62.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/82.0%

        \[\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/81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{{F}^{2}} - 1}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. sub-neg98.9%

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

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

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

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

    if -1 < F < 0.0539999999999999994

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity83.4%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      8. rem-sqrt-square83.4%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      9. rem-square-sqrt83.2%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr83.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt83.4%

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

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

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

    if 0.0539999999999999994 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/78.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/78.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. *-commutative78.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. Simplified78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 91.2% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 0.052:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\

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


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

    1. Initial program 66.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. +-commutative66.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-neg66.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/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. Taylor expanded in x around 0 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000009e-31 < F < 0.0519999999999999976

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity88.6%

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr88.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt88.6%

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

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

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

    if 0.0519999999999999976 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/78.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/78.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. *-commutative78.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. Simplified78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 91.6% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 0.054:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\

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


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

    1. Initial program 62.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. +-commutative62.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-neg62.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/82.0%

        \[\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/81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{1}{{F}^{2}} - 1}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. sub-neg98.9%

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

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

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

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

    if -1.19999999999999996 < F < 0.0539999999999999994

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity83.4%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      8. rem-sqrt-square83.4%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      9. rem-square-sqrt83.2%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr83.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt83.4%

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

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

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

    if 0.0539999999999999994 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/78.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/78.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. *-commutative78.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. Simplified78.5%

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

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

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

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

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

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

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

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

Alternative 10: 91.0% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 0.0225:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\

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


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

    1. Initial program 66.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. +-commutative66.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-neg66.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/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. Taylor expanded in x around 0 84.2%

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

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

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

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

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

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

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

    if -1.60000000000000009e-31 < F < 0.022499999999999999

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity88.6%

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr88.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt88.6%

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

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

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

    if 0.022499999999999999 < F

    1. Initial program 61.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. +-commutative61.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-neg61.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/78.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/78.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. *-commutative78.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. Simplified78.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0225:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 11: 84.5% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 1.85 \cdot 10^{-41}:\\
\;\;\;\;\frac{-x}{\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.9999999999999999e-47

    1. Initial program 69.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. +-commutative69.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. unsub-neg69.1%

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity85.3%

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

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

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

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

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

    if -3.9999999999999999e-47 < F < 1.8500000000000001e-41

    1. Initial program 99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg75.7%

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

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

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

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg2.2%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out2.2%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*2.2%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt1.1%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      13. sqrt-unprod37.3%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\sqrt{\color{blue}{x \cdot x}}}} \]
      15. sqrt-unprod54.8%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt75.6%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr75.6%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      3. tan-quot75.5%

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative75.5%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt34.0%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod24.7%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg24.7%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt2.2%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub02.2%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval2.2%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg2.2%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod24.7%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg24.7%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod34.0%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt75.5%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval75.5%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv75.7%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr75.7%

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

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    11. Simplified75.7%

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

    if 1.8500000000000001e-41 < F

    1. Initial program 64.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. +-commutative64.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-neg64.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/80.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/80.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. *-commutative80.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. Simplified80.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.85 \cdot 10^{-41}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 12: 76.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.054:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 3.2 \cdot 10^{+82}:\\
\;\;\;\;\left(\frac{1}{B} - \frac{1}{B \cdot \left(F \cdot F\right)}\right) - t_0\\

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

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


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

    1. Initial program 69.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. +-commutative69.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. unsub-neg69.1%

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity85.3%

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

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

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

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

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

    if -1.9999999999999999e-48 < F < 0.0539999999999999994

    1. Initial program 99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg73.5%

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

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

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

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg2.1%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out2.1%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*2.1%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt1.1%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      13. sqrt-unprod36.8%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      14. sqr-neg36.8%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt73.4%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr73.4%

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

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

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

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative73.4%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt31.6%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod23.0%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg23.0%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt2.1%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub02.1%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval2.1%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg2.1%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

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

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg23.0%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod31.6%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt73.4%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval73.4%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv73.5%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr73.5%

      \[\leadsto -\color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    10. Step-by-step derivation
      1. +-lft-identity73.5%

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

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

    if 0.0539999999999999994 < F < 3.19999999999999975e82

    1. Initial program 89.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. +-commutative89.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-neg89.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/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.3%

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity88.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      3. unpow288.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      4. fma-udef88.7%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr88.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt88.7%

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{B} - \frac{1}{{F}^{2} \cdot B}\right)} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. unpow284.0%

        \[\leadsto \left(\frac{1}{B} - \frac{1}{\color{blue}{\left(F \cdot F\right)} \cdot B}\right) - \frac{x}{\tan B} \]
    12. Simplified84.0%

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

    if 3.19999999999999975e82 < F < 8.49999999999999978e158

    1. Initial program 84.0%

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

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

    if 8.49999999999999978e158 < F

    1. Initial program 31.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. +-commutative31.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-neg31.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/58.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/58.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. *-commutative58.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. Simplified58.2%

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity58.2%

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      9. rem-square-sqrt58.2%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr58.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt58.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{-48}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.054:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+82}:\\ \;\;\;\;\left(\frac{1}{B} - \frac{1}{B \cdot \left(F \cdot F\right)}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+158}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 13: 69.9% accurate, 2.6× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 1.55 \cdot 10^{+83}:\\
\;\;\;\;\left(\frac{1}{B} - \frac{1}{B \cdot \left(F \cdot F\right)}\right) - t_0\\

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

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


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

    1. Initial program 37.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 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv87.3%

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr87.3%

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

    if -9.4999999999999996e157 < F < -2.0000000000000001e-26

    1. Initial program 86.0%

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

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

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

    if -2.0000000000000001e-26 < F < 3.40000000000000006e-6

    1. Initial program 99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg70.8%

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

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

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

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg2.1%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out2.1%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*2.1%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt1.1%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      14. sqr-neg37.0%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\sqrt{\color{blue}{x \cdot x}}}} \]
      15. sqrt-unprod52.8%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt70.7%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr70.7%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      3. tan-quot70.7%

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative70.7%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt31.2%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod23.3%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg23.3%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt2.1%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub02.1%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval2.1%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg2.1%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod23.3%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg23.3%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod31.2%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt70.7%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval70.7%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv70.9%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr70.9%

      \[\leadsto -\color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    10. Step-by-step derivation
      1. +-lft-identity70.9%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    11. Simplified70.9%

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

    if 3.40000000000000006e-6 < F < 1.54999999999999996e83

    1. Initial program 89.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. +-commutative89.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-neg89.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/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.3%

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.4%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity88.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      3. unpow288.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      4. fma-udef88.7%

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

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

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

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

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

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr88.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt88.7%

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{B} - \frac{1}{{F}^{2} \cdot B}\right)} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. unpow284.0%

        \[\leadsto \left(\frac{1}{B} - \frac{1}{\color{blue}{\left(F \cdot F\right)} \cdot B}\right) - \frac{x}{\tan B} \]
    12. Simplified84.0%

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

    if 1.54999999999999996e83 < F < 6.1e159

    1. Initial program 84.0%

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

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

    if 6.1e159 < F

    1. Initial program 31.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. +-commutative31.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-neg31.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/58.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/58.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. *-commutative58.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. Simplified58.2%

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity58.2%

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      9. rem-square-sqrt58.2%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr58.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt58.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{+157}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+83}:\\ \;\;\;\;\left(\frac{1}{B} - \frac{1}{B \cdot \left(F \cdot F\right)}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.1 \cdot 10^{+159}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 14: 69.8% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -3.5 \cdot 10^{+159}:\\ \;\;\;\;\frac{-1}{B} - t_0\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-41}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.12 \cdot 10^{+82} \lor \neg \left(F \leq 9.5 \cdot 10^{+158}\right):\\ \;\;\;\;\frac{1}{B} - t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -3.5e+159)
     (- (/ -1.0 B) t_0)
     (if (<= F -2e-26)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 1.4e-41)
         (/ (- x) (tan B))
         (if (or (<= F 1.12e+82) (not (<= F 9.5e+158)))
           (- (/ 1.0 B) t_0)
           (- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -3.5e+159) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -2e-26) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 1.4e-41) {
		tmp = -x / tan(B);
	} else if ((F <= 1.12e+82) || !(F <= 9.5e+158)) {
		tmp = (1.0 / B) - t_0;
	} else {
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-3.5d+159)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-2d-26)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 1.4d-41) then
        tmp = -x / tan(b)
    else if ((f <= 1.12d+82) .or. (.not. (f <= 9.5d+158))) then
        tmp = (1.0d0 / b) - t_0
    else
        tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -3.5e+159) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -2e-26) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 1.4e-41) {
		tmp = -x / Math.tan(B);
	} else if ((F <= 1.12e+82) || !(F <= 9.5e+158)) {
		tmp = (1.0 / B) - t_0;
	} else {
		tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -3.5e+159:
		tmp = (-1.0 / B) - t_0
	elif F <= -2e-26:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 1.4e-41:
		tmp = -x / math.tan(B)
	elif (F <= 1.12e+82) or not (F <= 9.5e+158):
		tmp = (1.0 / B) - t_0
	else:
		tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -3.5e+159)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -2e-26)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 1.4e-41)
		tmp = Float64(Float64(-x) / tan(B));
	elseif ((F <= 1.12e+82) || !(F <= 9.5e+158))
		tmp = Float64(Float64(1.0 / B) - t_0);
	else
		tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -3.5e+159)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -2e-26)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 1.4e-41)
		tmp = -x / tan(B);
	elseif ((F <= 1.12e+82) || ~((F <= 9.5e+158)))
		tmp = (1.0 / B) - t_0;
	else
		tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.5e+159], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2e-26], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-41], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.12e+82], N[Not[LessEqual[F, 9.5e+158]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-41}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 1.12 \cdot 10^{+82} \lor \neg \left(F \leq 9.5 \cdot 10^{+158}\right):\\
\;\;\;\;\frac{1}{B} - t_0\\

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


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

    1. Initial program 37.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 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv87.3%

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr87.3%

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

    if -3.4999999999999999e159 < F < -2.0000000000000001e-26

    1. Initial program 86.0%

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

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

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

    if -2.0000000000000001e-26 < F < 1.4000000000000001e-41

    1. Initial program 99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg72.6%

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      5. sqr-neg18.0%

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg2.2%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out2.2%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*2.2%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt1.1%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      14. sqr-neg37.5%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt72.5%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr72.5%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      3. tan-quot72.5%

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative72.5%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt33.3%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod24.9%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg24.9%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt2.2%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub02.2%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval2.2%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg2.2%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod24.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg24.9%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod33.3%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt72.5%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval72.5%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv72.7%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr72.7%

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

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    11. Simplified72.7%

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

    if 1.4000000000000001e-41 < F < 1.11999999999999998e82 or 9.49999999999999913e158 < F

    1. Initial program 57.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. +-commutative57.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-neg57.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/75.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/75.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. *-commutative75.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. Simplified75.9%

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{{F}^{2} + 2}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity75.9%

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity71.0%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      3. unpow271.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      4. fma-udef71.0%

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

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

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

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      8. rem-sqrt-square71.0%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      9. rem-square-sqrt70.8%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr70.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt71.0%

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

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

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

    if 1.11999999999999998e82 < F < 9.49999999999999913e158

    1. Initial program 84.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.5 \cdot 10^{+159}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-41}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.12 \cdot 10^{+82} \lor \neg \left(F \leq 9.5 \cdot 10^{+158}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 15: 70.8% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-41}:\\
\;\;\;\;\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 < -3.35000000000000009e159

    1. Initial program 37.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 99.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv87.3%

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr87.3%

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

    if -3.35000000000000009e159 < F < -2.0000000000000001e-26

    1. Initial program 86.0%

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

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

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

    if -2.0000000000000001e-26 < F < 2.8000000000000002e-41

    1. Initial program 99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg72.6%

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\sin B} \]
      5. sqr-neg18.0%

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg2.2%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out2.2%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*2.2%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt1.1%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      14. sqr-neg37.5%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt72.5%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr72.5%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      3. tan-quot72.5%

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative72.5%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt33.3%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod24.9%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg24.9%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt2.2%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub02.2%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval2.2%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg2.2%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod24.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg24.9%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod33.3%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt72.5%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval72.5%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv72.7%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr72.7%

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

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    11. Simplified72.7%

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

    if 2.8000000000000002e-41 < F

    1. Initial program 64.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. +-commutative64.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-neg64.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/80.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/80.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. *-commutative80.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. Simplified80.2%

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity63.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      3. unpow263.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      4. fma-udef63.8%

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

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

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

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

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      9. rem-square-sqrt63.6%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr63.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt63.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.35 \cdot 10^{+159}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 16: 70.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.9 \cdot 10^{-92}:\\ \;\;\;\;\frac{-1}{B} - t_0\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-41}:\\ \;\;\;\;\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 (tan B))))
   (if (<= F -2.9e-92)
     (- (/ -1.0 B) t_0)
     (if (<= F 1.1e-41) (/ (- x) (tan B)) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -2.9e-92) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= 1.1e-41) {
		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 / tan(b)
    if (f <= (-2.9d-92)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= 1.1d-41) 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 / Math.tan(B);
	double tmp;
	if (F <= -2.9e-92) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= 1.1e-41) {
		tmp = -x / Math.tan(B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -2.9e-92:
		tmp = (-1.0 / B) - t_0
	elif F <= 1.1e-41:
		tmp = -x / math.tan(B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2.9e-92)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= 1.1e-41)
		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 / tan(B);
	tmp = 0.0;
	if (F <= -2.9e-92)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= 1.1e-41)
		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[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.9e-92], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.1e-41], 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 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{-92}:\\
\;\;\;\;\frac{-1}{B} - t_0\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-41}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 72.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 79.3%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv60.3%

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr60.3%

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

    if -2.89999999999999985e-92 < F < 1.1e-41

    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 F around -inf 40.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg79.9%

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

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

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

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg2.1%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out2.1%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*2.1%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt1.0%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}} \]
      14. sqr-neg39.0%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\sqrt{\color{blue}{x \cdot x}}}} \]
      15. sqrt-unprod57.8%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt79.8%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr79.8%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      3. tan-quot79.7%

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative79.7%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt35.6%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod26.1%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg26.1%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt2.1%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub02.1%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval2.1%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg2.1%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod26.1%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg26.1%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod35.6%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt79.7%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval79.7%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv79.9%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr79.9%

      \[\leadsto -\color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    10. Step-by-step derivation
      1. +-lft-identity79.9%

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

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

    if 1.1e-41 < F

    1. Initial program 64.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. +-commutative64.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-neg64.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/80.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/80.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. *-commutative80.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. Simplified80.2%

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{{F}^{2} + 2}} \cdot 1}{B}} - \frac{x}{\tan B} \]
      2. *-rgt-identity63.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      3. unpow263.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      4. fma-udef63.8%

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

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

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

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

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      9. rem-square-sqrt63.6%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      10. fabs-sqr63.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      11. rem-square-sqrt63.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-92}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-41}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 17: 57.0% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-186} \lor \neg \left(x \leq 9.2 \cdot 10^{-233}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{-1 + x}{B}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e-186 or 9.2000000000000007e-233 < x

    1. Initial program 78.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg69.2%

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

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

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

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg1.7%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out1.7%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*1.7%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt0.7%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      13. sqrt-unprod31.4%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\sqrt{\color{blue}{x \cdot x}}}} \]
      15. sqrt-unprod45.4%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt69.1%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr69.1%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      3. tan-quot69.1%

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative69.1%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt34.8%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod24.0%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg24.0%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.8%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt1.7%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub01.7%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval1.7%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg1.7%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.8%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod24.0%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg24.0%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod34.8%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt69.1%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval69.1%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv69.2%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr69.2%

      \[\leadsto -\color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    10. Step-by-step derivation
      1. +-lft-identity69.2%

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

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

    if -1.15e-186 < x < 9.2000000000000007e-233

    1. Initial program 78.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in13.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval13.3%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-113.3%

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt8.4%

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B} \cdot \frac{-1 + \left(-x\right)}{B}}} \]
      3. pow213.4%

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{-1 + \left(-x\right)}{B}\right)}^{2}}} \]
      4. add-sqr-sqrt12.2%

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

        \[\leadsto \sqrt{{\left(\frac{-1 + \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{B}\right)}^{2}} \]
      6. sqr-neg13.4%

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

        \[\leadsto \sqrt{{\left(\frac{-1 + \color{blue}{\sqrt{x} \cdot \sqrt{x}}}{B}\right)}^{2}} \]
      8. add-sqr-sqrt13.4%

        \[\leadsto \sqrt{{\left(\frac{-1 + \color{blue}{x}}{B}\right)}^{2}} \]
    7. Applied egg-rr13.4%

      \[\leadsto \color{blue}{\sqrt{{\left(\frac{-1 + x}{B}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. unpow213.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 + x}{B} \cdot \frac{-1 + x}{B}}} \]
      2. rem-sqrt-square20.9%

        \[\leadsto \color{blue}{\left|\frac{-1 + x}{B}\right|} \]
    9. Simplified20.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-186} \lor \neg \left(x \leq 9.2 \cdot 10^{-233}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \]

Alternative 18: 62.8% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 72.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 79.3%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv60.3%

        \[\leadsto \frac{-1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr60.3%

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

    if -9.5000000000000001e-93 < F

    1. Initial program 81.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg61.8%

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

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

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

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg2.0%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out2.0%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*2.0%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt0.9%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      13. sqrt-unprod27.4%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\sqrt{\color{blue}{x \cdot x}}}} \]
      15. sqrt-unprod40.3%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt61.8%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr61.8%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{\sin B}{\cos B}}} \cdot x \]
      3. tan-quot61.7%

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative61.7%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt29.7%

        \[\leadsto -\color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      6. sqrt-unprod19.5%

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg19.5%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

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

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub02.0%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval2.0%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg2.0%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod19.5%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg19.5%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod29.7%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt61.7%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval61.7%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv61.8%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr61.8%

      \[\leadsto -\color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    10. Step-by-step derivation
      1. +-lft-identity61.8%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    11. Simplified61.8%

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

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

Alternative 19: 56.4% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+100} \lor \neg \left(F \leq -1.4 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -2.6000000000000002e100 or -1.40000000000000001e-19 < F

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
    6. Step-by-step derivation
      1. frac-2neg60.2%

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

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

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

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

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

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

        \[\leadsto -\frac{\cos B \cdot \color{blue}{x}}{-\sin B} \]
      8. remove-double-neg1.9%

        \[\leadsto -\frac{\color{blue}{-\left(-\cos B \cdot x\right)}}{-\sin B} \]
      9. distribute-rgt-neg-out1.9%

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot \left(-x\right)}{\sin B}} \]
      11. associate-/l*1.9%

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{-x}}} \]
      12. add-sqr-sqrt1.0%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}} \]
      13. sqrt-unprod27.1%

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

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\sqrt{\color{blue}{x \cdot x}}}} \]
      15. sqrt-unprod38.4%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}} \]
      16. add-sqr-sqrt60.2%

        \[\leadsto -\frac{\cos B}{\frac{\sin B}{\color{blue}{x}}} \]
    7. Applied egg-rr60.2%

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

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

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

        \[\leadsto -\frac{1}{\color{blue}{\tan B}} \cdot x \]
      4. *-commutative60.2%

        \[\leadsto -\color{blue}{x \cdot \frac{1}{\tan B}} \]
      5. add-sqr-sqrt30.1%

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

        \[\leadsto -\color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      7. sqr-neg21.2%

        \[\leadsto -\sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      8. sqrt-unprod0.9%

        \[\leadsto -\color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      9. add-sqr-sqrt1.9%

        \[\leadsto -\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      10. neg-sub01.9%

        \[\leadsto -\color{blue}{\left(0 - x \cdot \frac{1}{\tan B}\right)} \]
      11. metadata-eval1.9%

        \[\leadsto -\left(\color{blue}{\log 1} - x \cdot \frac{1}{\tan B}\right) \]
      12. sub-neg1.9%

        \[\leadsto -\color{blue}{\left(\log 1 + \left(-x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. add-sqr-sqrt0.9%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}}\right) \]
      14. sqrt-unprod21.2%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}}\right) \]
      15. sqr-neg21.2%

        \[\leadsto -\left(\log 1 + \sqrt{\color{blue}{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}}\right) \]
      16. sqrt-unprod30.1%

        \[\leadsto -\left(\log 1 + \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}}\right) \]
      17. add-sqr-sqrt60.2%

        \[\leadsto -\left(\log 1 + \color{blue}{x \cdot \frac{1}{\tan B}}\right) \]
      18. metadata-eval60.2%

        \[\leadsto -\left(\color{blue}{0} + x \cdot \frac{1}{\tan B}\right) \]
      19. un-div-inv60.3%

        \[\leadsto -\left(0 + \color{blue}{\frac{x}{\tan B}}\right) \]
    9. Applied egg-rr60.3%

      \[\leadsto -\color{blue}{\left(0 + \frac{x}{\tan B}\right)} \]
    10. Step-by-step derivation
      1. +-lft-identity60.3%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    11. Simplified60.3%

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

    if -2.6000000000000002e100 < F < -1.40000000000000001e-19

    1. Initial program 93.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 79.4%

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg43.7%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. *-commutative43.7%

        \[\leadsto \color{blue}{\left(B \cdot x\right) \cdot 0.3333333333333333} - \frac{1 + x}{B} \]
      5. *-commutative43.7%

        \[\leadsto \color{blue}{\left(x \cdot B\right)} \cdot 0.3333333333333333 - \frac{1 + x}{B} \]
      6. associate-*l*43.7%

        \[\leadsto \color{blue}{x \cdot \left(B \cdot 0.3333333333333333\right)} - \frac{1 + x}{B} \]
    6. Simplified43.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{+100} \lor \neg \left(F \leq -1.4 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \end{array} \]

Alternative 20: 31.5% accurate, 39.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-138} \lor \neg \left(x \leq 9.2 \cdot 10^{-181}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.60000000000000018e-138 or 9.19999999999999963e-181 < x

    1. Initial program 79.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in35.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval35.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-135.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg41.0%

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

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

    if -3.60000000000000018e-138 < x < 9.19999999999999963e-181

    1. Initial program 75.1%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in16.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval16.9%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-116.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{-138} \lor \neg \left(x \leq 9.2 \cdot 10^{-181}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 21: 36.6% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-93}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.2e-93) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.2e-93) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.2d-93)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = -x / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.2e-93) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.2e-93:
		tmp = (-1.0 - x) / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.2e-93)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.2e-93)
		tmp = (-1.0 - x) / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.2e-93], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 72.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 79.3%

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval39.0%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-139.0%

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

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

    if -2.19999999999999996e-93 < F

    1. Initial program 81.3%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in24.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval24.1%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-124.1%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg34.0%

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

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

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

Alternative 22: 10.3% accurate, 108.0× speedup?

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

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 78.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 55.3%

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval29.4%

      \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
    4. neg-mul-129.4%

      \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
  5. Simplified29.4%

    \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
  6. Taylor expanded in x around 0 9.7%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification9.7%

    \[\leadsto \frac{-1}{B} \]

Reproduce

?
herbie shell --seed 2023215 
(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))))))