VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.8% → 99.7%
Time: 18.6s
Alternatives: 26
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 26 alternatives:

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

Initial Program: 77.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 24.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. +-commutative24.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-neg24.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/53.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/53.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. *-commutative53.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. Simplified53.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 53.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/53.2%

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

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

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

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

    1. Initial program 96.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. +-commutative96.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-neg96.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/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.7%

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

    if 9.99999999999999977e37 < F

    1. Initial program 63.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. +-commutative63.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-neg63.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/74.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 50.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. +-commutative50.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-neg50.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/73.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/73.4%

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

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

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

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

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

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

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

    if -1e12 < F < 5.0000000000000004e127

    1. Initial program 96.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. +-commutative96.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-neg96.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/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.5%

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e127 < 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/65.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/65.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. *-commutative65.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. Simplified65.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 65.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/65.3%

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 49.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. +-commutative49.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-neg49.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/72.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/72.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. *-commutative72.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. Simplified72.6%

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

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

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

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

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

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

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

    if -5e13 < F < 1.99999999999999991e37

    1. Initial program 99.5%

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

    if 1.99999999999999991e37 < F

    1. Initial program 63.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. +-commutative63.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-neg63.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/74.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 50.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. +-commutative50.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-neg50.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/73.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/73.4%

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.48

    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.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 F around 0 97.3%

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

    if 1.48 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/76.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/76.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. *-commutative76.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. Simplified76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 50.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. +-commutative50.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-neg50.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/73.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/73.4%

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.3799999999999999

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

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

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

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

    if 1.3799999999999999 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/76.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/76.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. *-commutative76.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. Simplified76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 50.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. +-commutative50.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-neg50.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/73.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/73.4%

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.3500000000000001

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

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

    if 1.3500000000000001 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/76.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/76.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. *-commutative76.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. Simplified76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 91.7% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < 1.5499999999999999e-152

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5499999999999999e-152 < F < 1700

    1. Initial program 99.3%

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

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

    1. Initial program 64.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. +-commutative64.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-neg64.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/75.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/75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 91.8% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < 450

    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 B around 0 84.0%

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

    if 450 < F

    1. Initial program 64.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. +-commutative64.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-neg64.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/75.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/75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 91.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 3.1 \cdot 10^{-15}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - t_0\\

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < 3.0999999999999999e-15

    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.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 B around 0 85.8%

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

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

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

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

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

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

    if 3.0999999999999999e-15 < F

    1. Initial program 67.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. +-commutative67.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-neg67.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/78.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/77.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. *-commutative77.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. Simplified78.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 77.9%

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

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

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

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

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

      \[\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. sqrt-div77.9%

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

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

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

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

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

Alternative 10: 91.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 3.1 \cdot 10^{-15}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < 3.0999999999999999e-15

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} - \frac{x}{\tan B} \]
      2. associate-/r/85.7%

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{B} \cdot F} - \frac{x}{\tan B} \]
    12. Simplified85.7%

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

    if 3.0999999999999999e-15 < F

    1. Initial program 67.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. +-commutative67.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-neg67.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/78.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/77.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. *-commutative77.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. Simplified78.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 77.9%

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

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

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

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

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

      \[\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. sqrt-div77.9%

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

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

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

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

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

Alternative 11: 91.8% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < 1.0600000000000001

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} - \frac{x}{\tan B} \]
      2. associate-/r/83.2%

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

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

    if 1.0600000000000001 < F

    1. Initial program 65.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. +-commutative65.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-neg65.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/76.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/76.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. *-commutative76.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. Simplified76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 91.4% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 3.1 \cdot 10^{-15}:\\
\;\;\;\;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.03999999999999999e-13

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < 3.0999999999999999e-15

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} - \frac{x}{\tan B} \]
      2. associate-/r/85.7%

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{B} \cdot F} - \frac{x}{\tan B} \]
    12. Simplified85.7%

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

    if 3.0999999999999999e-15 < F

    1. Initial program 67.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. +-commutative67.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-neg67.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/78.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/77.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. *-commutative77.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. Simplified78.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 77.9%

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

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

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

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

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

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

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

Alternative 13: 84.8% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -6.8e-21 < F < 7.00000000000000007e-20

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.00000000000000007e-20 < F

    1. Initial program 68.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. +-commutative68.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-neg68.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/78.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/78.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. *-commutative78.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. Simplified78.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 78.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/78.2%

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

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

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

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

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

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

Alternative 14: 71.1% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < 4.5000000000000001e-39

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

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

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

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

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

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

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

    if 4.5000000000000001e-39 < F

    1. Initial program 69.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. +-commutative69.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-neg69.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/78.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/78.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. *-commutative78.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. Simplified79.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 B around 0 63.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{B} + \left(-\frac{1}{B \cdot \color{blue}{\left(F \cdot F\right)}}\right)\right) - \frac{x}{\tan B} \]
      6. distribute-neg-frac71.8%

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

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

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

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

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

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

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

Alternative 15: 71.0% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

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

    if -1.01999999999999997e-17 < F < 1.5999999999999999e-39

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5999999999999999e-39 < F

    1. Initial program 69.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. +-commutative69.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-neg69.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/78.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/78.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. *-commutative78.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. Simplified79.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 B around 0 63.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{B} + \left(-\frac{1}{B \cdot \color{blue}{\left(F \cdot F\right)}}\right)\right) - \frac{x}{\tan B} \]
      6. distribute-neg-frac71.8%

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

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

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

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

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

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

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

Alternative 16: 77.4% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

    if -1.04999999999999996e-17 < F < 4.5000000000000001e-39

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5000000000000001e-39 < F

    1. Initial program 69.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. +-commutative69.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-neg69.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/78.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/78.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. *-commutative78.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. Simplified79.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 B around 0 63.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{B} + \left(-\frac{1}{B \cdot \color{blue}{\left(F \cdot F\right)}}\right)\right) - \frac{x}{\tan B} \]
      6. distribute-neg-frac71.8%

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

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

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

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

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

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

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

Alternative 17: 62.1% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;F \leq -9.6 \cdot 10^{-275} \lor \neg \left(F \leq 9.5 \cdot 10^{-281}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

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


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

    1. Initial program 53.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. +-commutative53.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-neg53.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/75.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/75.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. *-commutative75.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. Simplified75.1%

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

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

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

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

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

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

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

    if -1.03999999999999999e-13 < F < -9.59999999999999962e-275 or 9.5000000000000003e-281 < F

    1. Initial program 83.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. +-commutative83.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-neg83.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/89.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/88.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. *-commutative88.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. Simplified89.1%

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

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

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

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

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

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

    if -9.59999999999999962e-275 < F < 9.5000000000000003e-281

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in26.1%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval26.1%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-126.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.04 \cdot 10^{-13}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.6 \cdot 10^{-275} \lor \neg \left(F \leq 9.5 \cdot 10^{-281}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 18: 61.0% accurate, 2.9× speedup?

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

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

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

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


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

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

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

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

    if -4.80000000000000003e-270 < F < 2.6e-280

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in24.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval24.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-124.5%

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

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

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

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

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

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

    if 2.6e-280 < F

    1. Initial program 78.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. +-commutative78.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-neg78.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/85.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/85.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{-270}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.6 \cdot 10^{-280}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 19: 61.0% accurate, 2.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

    if -1.24999999999999995e-272 < F < 3.6999999999999998e-280

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in24.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval24.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-124.5%

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

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

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

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

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

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

    if 3.6999999999999998e-280 < F

    1. Initial program 78.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. +-commutative78.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-neg78.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/85.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/85.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-272}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-280}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 20: 50.7% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-37}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -8.5e-109)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 7e-37)
     (/ (- x) B)
     (+
      (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
      (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.5e-109) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 7e-37) {
		tmp = -x / B;
	} else {
		tmp = (B * (0.16666666666666666 + (x * 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 <= (-8.5d-109)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 7d-37) then
        tmp = -x / b
    else
        tmp = (b * (0.16666666666666666d0 + (x * 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 <= -8.5e-109) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 7e-37) {
		tmp = -x / B;
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -8.5e-109:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 7e-37:
		tmp = -x / B
	else:
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -8.5e-109)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 7e-37)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -8.5e-109)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 7e-37)
		tmp = -x / B;
	else
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-109], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-37], N[((-x) / B), $MachinePrecision], N[(N[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\


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

    1. Initial program 62.2%

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

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

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

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

    if -8.50000000000000005e-109 < F < 7.0000000000000003e-37

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.4%

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

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

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

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

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

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

    if 7.0000000000000003e-37 < F

    1. Initial program 68.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. +-commutative68.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-neg68.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/78.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate--l+46.9%

        \[\leadsto \color{blue}{\left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative46.9%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. *-commutative46.9%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{x \cdot 0.3333333333333333}\right) + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      4. div-sub46.9%

        \[\leadsto B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \color{blue}{\frac{1 - x}{B}} \]
    9. Simplified46.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-37}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 21: 43.7% accurate, 18.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{-80}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\

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

\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\


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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    5. Step-by-step derivation
      1. +-commutative46.8%

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

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg46.8%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. *-commutative46.8%

        \[\leadsto \color{blue}{\left(B \cdot x\right) \cdot 0.3333333333333333} - \frac{1 + x}{B} \]
      5. associate-*l*46.8%

        \[\leadsto \color{blue}{B \cdot \left(x \cdot 0.3333333333333333\right)} - \frac{1 + x}{B} \]
    6. Simplified46.8%

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

    if -3.00000000000000007e-80 < F < 1.42e-37

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.6%

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

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

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

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

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

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

    if 1.42e-37 < F

    1. Initial program 68.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. +-commutative68.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-neg68.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/78.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate--l+46.9%

        \[\leadsto \color{blue}{\left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative46.9%

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. *-commutative46.9%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{x \cdot 0.3333333333333333}\right) + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      4. div-sub46.9%

        \[\leadsto B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \color{blue}{\frac{1 - x}{B}} \]
    9. Simplified46.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-80}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{-37}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 22: 43.7% accurate, 24.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-77}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\

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

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


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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    5. Step-by-step derivation
      1. +-commutative46.8%

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

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg46.8%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. *-commutative46.8%

        \[\leadsto \color{blue}{\left(B \cdot x\right) \cdot 0.3333333333333333} - \frac{1 + x}{B} \]
      5. associate-*l*46.8%

        \[\leadsto \color{blue}{B \cdot \left(x \cdot 0.3333333333333333\right)} - \frac{1 + x}{B} \]
    6. Simplified46.8%

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

    if -2.10000000000000015e-77 < F < 5.50000000000000005e-38

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.6%

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

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

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

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

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

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

    if 5.50000000000000005e-38 < F

    1. Initial program 68.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. +-commutative68.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-neg68.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/78.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.1 \cdot 10^{-77}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 23: 43.4% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-37}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -8.5e-109)
   (/ (- -1.0 x) B)
   (if (<= F 7e-37) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.5e-109) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 7e-37) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-8.5d-109)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 7d-37) then
        tmp = -x / b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.5e-109) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 7e-37) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -8.5e-109:
		tmp = (-1.0 - x) / B
	elif F <= 7e-37:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -8.5e-109)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 7e-37)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -8.5e-109)
		tmp = (-1.0 - x) / B;
	elseif (F <= 7e-37)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-37], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 62.2%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in45.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval45.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-145.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub45.5%

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

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

    if -8.50000000000000005e-109 < F < 7.0000000000000003e-37

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.4%

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

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

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

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

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

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

    if 7.0000000000000003e-37 < F

    1. Initial program 68.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. +-commutative68.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-neg68.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/78.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-37}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 24: 36.3% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -8.5e-109) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.5e-109) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-8.5d-109)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = -x / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -8.5e-109) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -8.5e-109:
		tmp = (-1.0 - x) / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -8.5e-109)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -8.5e-109)
		tmp = (-1.0 - x) / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 62.2%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in45.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval45.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-145.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub45.5%

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

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

    if -8.50000000000000005e-109 < F

    1. Initial program 83.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 45.2%

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval23.0%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-123.0%

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

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

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

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

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

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

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

Alternative 25: 29.9% accurate, 81.0× speedup?

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

\\
\frac{-x}{B}
\end{array}
Derivation
  1. Initial program 77.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 57.7%

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in30.1%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval30.1%

      \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
    4. neg-mul-130.1%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  9. Final simplification31.4%

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

Alternative 26: 10.1% 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 77.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 57.7%

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in30.1%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval30.1%

      \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
    4. neg-mul-130.1%

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification7.8%

    \[\leadsto \frac{-1}{B} \]

Reproduce

?
herbie shell --seed 2023252 
(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))))))