VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.7% → 99.7%
Time: 28.1s
Alternatives: 20
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 20 alternatives:

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

Initial Program: 77.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -29500000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 580000000:\\ \;\;\;\;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 -29500000000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 580000000.0)
       (- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -29500000000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 580000000.0) {
		tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -29500000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 580000000.0)
		tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -29500000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 580000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 580000000:\\
\;\;\;\;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 < -2.95e13

    1. Initial program 56.1%

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

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

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

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

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

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

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

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

    1. Initial program 99.5%

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

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

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

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

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

    if 5.8e8 < F

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -29500000000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 580000000:\\ \;\;\;\;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.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 52.6%

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

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

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

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

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

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 2e8 < F

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.3999999999999999

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{{F}^{2} + 2}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. 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. Taylor expanded in F around 0 99.1%

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

    if 1.3999999999999999 < F

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.5% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

    if -3.3000000000000003e-33 < F < 8.79999999999999943e-82

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\cos B}{\frac{\sin B}{x}}} \]
    6. Step-by-step derivation
      1. clear-num75.8%

        \[\leadsto -\color{blue}{\frac{1}{\frac{\frac{\sin B}{x}}{\cos B}}} \]
      2. associate-/r/75.7%

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

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

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

    if 8.79999999999999943e-82 < F < 6.9999999999999998e-9

    1. Initial program 99.5%

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

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

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

    if 6.9999999999999998e-9 < F

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.8 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 5: 91.8% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\
\;\;\;\;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.45000000000000002e-27

    1. Initial program 62.0%

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

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

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

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

    if -1.45000000000000002e-27 < F < 6.9999999999999998e-9

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999998e-9 < F

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 72.5% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 58.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 99.6%

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

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

    if -0.75 < F < 9.0000000000000001e-77

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\cos B}{\frac{\sin B}{x}}} \]
    6. Step-by-step derivation
      1. clear-num73.0%

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

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

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

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

    if 9.0000000000000001e-77 < F < 6.9999999999999998e-9

    1. Initial program 99.5%

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

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

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

    if 6.9999999999999998e-9 < F

    1. Initial program 57.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. associate-*l/74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.75:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{-77}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 7: 78.5% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.36e-33 < F < 2.06000000000000008e-78

    1. Initial program 99.5%

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\cos B}{\frac{\sin B}{x}}} \]
    6. Step-by-step derivation
      1. clear-num75.8%

        \[\leadsto -\color{blue}{\frac{1}{\frac{\frac{\sin B}{x}}{\cos B}}} \]
      2. associate-/r/75.7%

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

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

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

    if 2.06000000000000008e-78 < F < 6.9999999999999998e-9

    1. Initial program 99.5%

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

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

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

    if 6.9999999999999998e-9 < F

    1. Initial program 57.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. associate-*l/74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.36 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.06 \cdot 10^{-78}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 8: 64.2% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -1.95 \cdot 10^{-214}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 2.85 \cdot 10^{-297}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

\mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 62.5%

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

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

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

    if -6.8000000000000001e-33 < F < -1.95000000000000019e-214 or 2.8499999999999999e-297 < F < 6.9999999999999998e-9

    1. Initial program 99.5%

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

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

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

    if -1.95000000000000019e-214 < F < 2.8499999999999999e-297

    1. Initial program 99.5%

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

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

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

    if 6.9999999999999998e-9 < F

    1. Initial program 57.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. associate-*l/74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.95 \cdot 10^{-214}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 2.85 \cdot 10^{-297}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 9: 64.8% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -5.4 \cdot 10^{-217}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 6.5 \cdot 10^{-291}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\

\mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 62.5%

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

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

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

    if -6.8000000000000001e-33 < F < -5.40000000000000032e-217 or 6.50000000000000002e-291 < F < 6.9999999999999998e-9

    1. Initial program 99.5%

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

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

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

    if -5.40000000000000032e-217 < F < 6.50000000000000002e-291

    1. Initial program 99.5%

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

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

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

    if 6.9999999999999998e-9 < F

    1. Initial program 57.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. associate-*l/74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.4 \cdot 10^{-217}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-291}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 7 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 10: 60.5% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq 1.95 \cdot 10^{-297}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

\mathbf{elif}\;F \leq 1.18 \cdot 10^{-182}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\

\mathbf{elif}\;F \leq 6.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{-1}{B} + \frac{-1}{\frac{\tan B}{x}}\\

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


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

    1. Initial program 41.2%

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

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

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

    if -2.9000000000000002e112 < F < 1.9500000000000001e-297

    1. Initial program 96.5%

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

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

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

    if 1.9500000000000001e-297 < F < 1.17999999999999997e-182

    1. Initial program 99.5%

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    7. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto -\left(\frac{x}{B} + \color{blue}{B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}\right) \]
      2. distribute-rgt-out--69.8%

        \[\leadsto -\left(\frac{x}{B} + B \cdot \color{blue}{\left(x \cdot \left(-0.5 - -0.16666666666666666\right)\right)}\right) \]
      3. metadata-eval69.8%

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

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

    if 1.17999999999999997e-182 < F < 6.60000000000000011e-44

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

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

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

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

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

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

    if 6.60000000000000011e-44 < F

    1. Initial program 59.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. associate-*l/76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+112}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-297}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 1.18 \cdot 10^{-182}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{-1}{B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 11: 55.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -850:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-283} \lor \neg \left(F \leq 9.4 \cdot 10^{-189}\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 -850.0)
   (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x)))
   (if (or (<= F 2.2e-283) (not (<= F 9.4e-189)))
     (- (/ 1.0 B) (/ x (tan B)))
     (/ (- x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -850.0) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if ((F <= 2.2e-283) || !(F <= 9.4e-189)) {
		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 <= (-850.0d0)) then
        tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
    else if ((f <= 2.2d-283) .or. (.not. (f <= 9.4d-189))) 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 <= -850.0) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if ((F <= 2.2e-283) || !(F <= 9.4e-189)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -850.0:
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x))
	elif (F <= 2.2e-283) or not (F <= 9.4e-189):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -850.0)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x)));
	elseif ((F <= 2.2e-283) || !(F <= 9.4e-189))
		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 <= -850.0)
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	elseif ((F <= 2.2e-283) || ~((F <= 9.4e-189)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -850.0], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 2.2e-283], N[Not[LessEqual[F, 9.4e-189]], $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 -850:\\
\;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\

\mathbf{elif}\;F \leq 2.2 \cdot 10^{-283} \lor \neg \left(F \leq 9.4 \cdot 10^{-189}\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 < -850

    1. Initial program 58.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 99.6%

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

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

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

    if -850 < F < 2.1999999999999998e-283 or 9.3999999999999993e-189 < 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. distribute-lft-neg-in78.8%

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

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

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

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

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

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

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

    if 2.1999999999999998e-283 < F < 9.3999999999999993e-189

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -850:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-283} \lor \neg \left(F \leq 9.4 \cdot 10^{-189}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 12: 61.6% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.98:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-283} \lor \neg \left(F \leq 8.6 \cdot 10^{-185}\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 -0.98)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F 6e-283) (not (<= F 8.6e-185)))
     (- (/ 1.0 B) (/ x (tan B)))
     (/ (- x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.98) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= 6e-283) || !(F <= 8.6e-185)) {
		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 <= (-0.98d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= 6d-283) .or. (.not. (f <= 8.6d-185))) 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 <= -0.98) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= 6e-283) || !(F <= 8.6e-185)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.98:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= 6e-283) or not (F <= 8.6e-185):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.98)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= 6e-283) || !(F <= 8.6e-185))
		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 <= -0.98)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= 6e-283) || ~((F <= 8.6e-185)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.98], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 6e-283], N[Not[LessEqual[F, 8.6e-185]], $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 -0.98:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{-283} \lor \neg \left(F \leq 8.6 \cdot 10^{-185}\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 < -0.97999999999999998

    1. Initial program 58.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 99.6%

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

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

    if -0.97999999999999998 < F < 5.99999999999999992e-283 or 8.6000000000000001e-185 < 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. distribute-lft-neg-in78.8%

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

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

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

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

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

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

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

    if 5.99999999999999992e-283 < F < 8.6000000000000001e-185

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.98:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-283} \lor \neg \left(F \leq 8.6 \cdot 10^{-185}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 13: 61.2% accurate, 2.9× speedup?

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

\mathbf{elif}\;F \leq 4 \cdot 10^{-297}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

\mathbf{elif}\;F \leq 1.16 \cdot 10^{-190}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\

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


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

    1. Initial program 41.2%

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

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

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

    if -1.2499999999999999e111 < F < 4.00000000000000016e-297

    1. Initial program 96.5%

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

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

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

    if 4.00000000000000016e-297 < F < 1.16e-190

    1. Initial program 99.5%

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\left(\frac{x}{B} + \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B\right)} \]
    7. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto -\left(\frac{x}{B} + \color{blue}{B \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}\right) \]
      2. distribute-rgt-out--69.8%

        \[\leadsto -\left(\frac{x}{B} + B \cdot \color{blue}{\left(x \cdot \left(-0.5 - -0.16666666666666666\right)\right)}\right) \]
      3. metadata-eval69.8%

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

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

    if 1.16e-190 < F

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{+111}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-297}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 1.16 \cdot 10^{-190}:\\ \;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 14: 44.3% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.6 \cdot 10^{-37}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 2.5 \cdot 10^{-47}:\\ \;\;\;\;\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 -3.6e-37)
   (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x)))
   (if (<= F 2.5e-47)
     (/ (- x) B)
     (+
      (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
      (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.6e-37) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 2.5e-47) {
		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 <= (-3.6d-37)) then
        tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
    else if (f <= 2.5d-47) 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 <= -3.6e-37) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 2.5e-47) {
		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 <= -3.6e-37:
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x))
	elif F <= 2.5e-47:
		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 <= -3.6e-37)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x)));
	elseif (F <= 2.5e-47)
		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 <= -3.6e-37)
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	elseif (F <= 2.5e-47)
		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, -3.6e-37], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-47], 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.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\

\mathbf{elif}\;F \leq 2.5 \cdot 10^{-47}:\\
\;\;\;\;\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.60000000000000007e-37

    1. Initial program 62.9%

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

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

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

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

    if -3.60000000000000007e-37 < F < 2.50000000000000006e-47

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 2.50000000000000006e-47 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

      \[\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+54.3%

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

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

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

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

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

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

Alternative 15: 44.2% accurate, 24.8× speedup?

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

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

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

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


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

    1. Initial program 62.9%

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

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

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

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

    if -3.89999999999999981e-40 < F < 4.2000000000000001e-47

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000001e-47 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

Alternative 16: 31.0% accurate, 35.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{-41} \lor \neg \left(x \leq 4 \cdot 10^{-108}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -5.4e-41) (not (<= x 4e-108))) (/ (- x) B) (/ (+ -1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -5.4e-41) || !(x <= 4e-108)) {
		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 ((x <= (-5.4d-41)) .or. (.not. (x <= 4d-108))) 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 ((x <= -5.4e-41) || !(x <= 4e-108)) {
		tmp = -x / B;
	} else {
		tmp = (-1.0 + x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -5.4e-41) or not (x <= 4e-108):
		tmp = -x / B
	else:
		tmp = (-1.0 + x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -5.4e-41) || !(x <= 4e-108))
		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 ((x <= -5.4e-41) || ~((x <= 4e-108)))
		tmp = -x / B;
	else
		tmp = (-1.0 + x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -5.4e-41], N[Not[LessEqual[x, 4e-108]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-41} \lor \neg \left(x \leq 4 \cdot 10^{-108}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4e-41 or 4.00000000000000016e-108 < x

    1. Initial program 77.6%

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

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

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

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

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

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

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

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

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

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

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

    if -5.4e-41 < x < 4.00000000000000016e-108

    1. Initial program 70.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u8.2%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-1 + \left(-x\right)}{B}\right)} - 1} \]
      3. add-sqr-sqrt5.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{-1 + \color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{B}\right)} - 1 \]
      4. sqrt-unprod7.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{-1 + \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{B}\right)} - 1 \]
      5. sqr-neg7.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{-1 + \sqrt{\color{blue}{x \cdot x}}}{B}\right)} - 1 \]
      6. sqrt-unprod2.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{-1 + \color{blue}{\sqrt{x} \cdot \sqrt{x}}}{B}\right)} - 1 \]
      7. add-sqr-sqrt7.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 + x}{B}} \]
    9. Simplified18.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{-41} \lor \neg \left(x \leq 4 \cdot 10^{-108}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + x}{B}\\ \end{array} \]

Alternative 17: 44.2% accurate, 35.5× speedup?

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

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

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

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


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

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    6. Simplified55.2%

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

    if -1.29999999999999997e-33 < F < 1.35e-46

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.35e-46 < F

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-46}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 18: 31.0% accurate, 39.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{-37} \lor \neg \left(x \leq 2 \cdot 10^{-110}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.85e-37 or 2.0000000000000001e-110 < x

    1. Initial program 77.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.85e-37 < x < 2.0000000000000001e-110

    1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{-37} \lor \neg \left(x \leq 2 \cdot 10^{-110}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 19: 37.2% accurate, 45.9× speedup?

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

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

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


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

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    6. Simplified55.2%

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

    if -1.4500000000000001e-42 < F

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 10.6% 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 74.5%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification11.6%

    \[\leadsto \frac{-1}{B} \]

Reproduce

?
herbie shell --seed 2023275 
(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))))))