VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.3% → 99.2%
Time: 22.7s
Alternatives: 33
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 33 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.3% 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.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;F \leq 3.5 \cdot 10^{+161}:\\
\;\;\;\;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}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\


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

    1. Initial program 32.1%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u46.2%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-146.2%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp39.5%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef39.5%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-139.5%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp33.1%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative33.1%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp39.5%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.8%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg99.8%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Simplified99.8%

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

    if -3.80000000000000026e144 < F < 3.49999999999999988e161

    1. Initial program 93.7%

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

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

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

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

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

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

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

    if 3.49999999999999988e161 < F

    1. Initial program 20.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.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{+144}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{+161}:\\ \;\;\;\;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}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 2: 99.5% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B}{\frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}}}\\


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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv45.1%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp44.4%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef44.4%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-144.4%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp39.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative39.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp44.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.7%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg99.7%

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

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

    if -2.39999999999999991e32 < F < 1.3500000000000001

    1. Initial program 99.6%

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

    if 1.3500000000000001 < F

    1. Initial program 47.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/67.9%

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

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

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

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

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

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

        \[\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*67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{\sin B}{\frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}}}\\


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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv45.1%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp44.4%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef44.4%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-144.4%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp39.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative39.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp44.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.7%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg99.7%

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

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

    if -2.39999999999999991e32 < F < 1.3500000000000001

    1. Initial program 99.6%

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

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

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

    if 1.3500000000000001 < F

    1. Initial program 47.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/67.9%

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

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

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

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

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

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

        \[\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*67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.95:\\
\;\;\;\;F \cdot \left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{t_1}}\right) - \frac{x}{\tan B}\\

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


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

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/68.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. +-commutative68.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. *-commutative68.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-udef68.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-def68.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-eval68.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-eval68.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*68.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-def68.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-udef68.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. *-commutative68.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-def68.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-def68.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-rr68.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. Step-by-step derivation
      1. clear-num68.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\color{blue}{-0.5 \cdot \frac{2 \cdot x + 2}{F} + -1 \cdot F}}}} \]
    9. Step-by-step derivation
      1. neg-mul-199.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\frac{-1 \cdot 1 + \color{blue}{-1} \cdot x}{F} - F}}} \]
      10. distribute-lft-in99.0%

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

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

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

    if -0.92000000000000004 < F < 0.94999999999999996

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 0.94999999999999996 < F

    1. Initial program 47.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/67.9%

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

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

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

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

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

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

        \[\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*67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.98:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{t_1}}}{\sin B} - \frac{x}{\tan B}\\

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


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

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/68.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. +-commutative68.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. *-commutative68.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-udef68.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-def68.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-eval68.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-eval68.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*68.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-def68.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-udef68.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. *-commutative68.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-def68.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-def68.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-rr68.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. Step-by-step derivation
      1. clear-num68.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\color{blue}{-0.5 \cdot \frac{2 \cdot x + 2}{F} + -1 \cdot F}}}} \]
    9. Step-by-step derivation
      1. neg-mul-199.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\frac{-1 \cdot 1 + \color{blue}{-1} \cdot x}{F} - F}}} \]
      10. distribute-lft-in99.0%

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

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

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

    if -1.05000000000000004 < F < 0.97999999999999998

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 0.97999999999999998 < F

    1. Initial program 47.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/67.9%

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

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

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

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

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

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

        \[\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*67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.82:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B}{\frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}}}\\


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

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/68.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. +-commutative68.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. *-commutative68.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-udef68.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-def68.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-eval68.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-eval68.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*68.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-def68.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-udef68.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. *-commutative68.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-def68.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-def68.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-rr68.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. Step-by-step derivation
      1. clear-num68.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\color{blue}{-0.5 \cdot \frac{2 \cdot x + 2}{F} + -1 \cdot F}}}} \]
    9. Step-by-step derivation
      1. neg-mul-199.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\frac{-1 \cdot 1 + \color{blue}{-1} \cdot x}{F} - F}}} \]
      10. distribute-lft-in99.0%

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

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

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

    if -0.880000000000000004 < F < 0.819999999999999951

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 0.819999999999999951 < F

    1. Initial program 47.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/67.9%

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

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

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

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

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

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

        \[\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*67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 91.3% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.2 \cdot 10^{-45}:\\
\;\;\;\;\sqrt{\frac{1}{t_0}} \cdot \frac{F}{B} - t_1\\

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


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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv45.1%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp44.4%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef44.4%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-144.4%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp39.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative39.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp44.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.7%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg99.7%

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

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

    if -2.39999999999999991e32 < F < -1.6e-29

    1. Initial program 99.6%

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

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

    if -1.6e-29 < F < 1.19999999999999995e-45

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

    if 1.19999999999999995e-45 < F

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

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

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

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

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

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

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

        \[\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*72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{+32}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-29}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-45}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{\sin B}{\frac{F}{F + 0.5 \cdot \frac{2 + x \cdot 2}{F}}}}\\ \end{array} \]

Alternative 8: 92.1% accurate, 1.5× speedup?

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

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

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

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

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


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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv45.1%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp44.4%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef44.4%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-144.4%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp39.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative39.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp44.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.7%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg99.7%

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

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

    if -2.39999999999999991e32 < F < -3.8000000000000003e-30

    1. Initial program 99.6%

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

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

    if -3.8000000000000003e-30 < F < 0.640000000000000013

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 0.640000000000000013 < F

    1. Initial program 47.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. Recombined 4 regimes into one program.
  4. Final simplification93.3%

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

Alternative 9: 92.0% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 56.9%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u45.5%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr45.5%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p98.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp45.1%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef45.1%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-145.1%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp40.9%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative40.9%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp45.1%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Simplified98.0%

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

    if -5.19999999999999954e-4 < F < -1.14999999999999996e-29

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified92.8%

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

    if -1.14999999999999996e-29 < F < 0.849999999999999978

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 0.849999999999999978 < F

    1. Initial program 47.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. Recombined 4 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00052:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 0.85:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 10: 92.1% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 0.2:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\

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


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

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/68.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. +-commutative68.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. *-commutative68.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-udef68.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-def68.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-eval68.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-eval68.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*68.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-def68.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-udef68.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. *-commutative68.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-def68.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-def68.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-rr68.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. Step-by-step derivation
      1. clear-num68.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\color{blue}{-0.5 \cdot \frac{2 \cdot x + 2}{F} + -1 \cdot F}}}} \]
    9. Step-by-step derivation
      1. neg-mul-199.0%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\frac{-1 \cdot 1 + \color{blue}{-1} \cdot x}{F} - F}}} \]
      10. distribute-lft-in99.0%

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

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

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

    if -0.035000000000000003 < F < -1.07999999999999995e-29

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified92.8%

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

    if -1.07999999999999995e-29 < F < 0.20000000000000001

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 0.20000000000000001 < F

    1. Initial program 47.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. Recombined 4 regimes into one program.
  4. Final simplification93.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.035:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\frac{\sin B}{\frac{F}{\frac{-1 - x}{F} - F}}}\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 0.2:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 11: 84.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.58 \cdot 10^{-108}:\\
\;\;\;\;t_0 \cdot \left(F \cdot \sqrt{0.5}\right)\\

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

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

\mathbf{elif}\;F \leq 12000000:\\
\;\;\;\;t_1 + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1 + t_0\\


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

    1. Initial program 56.9%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u45.5%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr45.5%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p98.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp45.1%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef45.1%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-145.1%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp40.9%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative40.9%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp45.1%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Simplified98.0%

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

    if -1.3999999999999999e-4 < F < -1.5799999999999999e-108

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr70.3%

      \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]

    if -1.5799999999999999e-108 < F < 2.2999999999999999e-101

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in F around 0 86.0%

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

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

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

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

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

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

    if 2.2999999999999999e-101 < F < 2.4000000000000001e-58

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified85.7%

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

    if 2.4000000000000001e-58 < F < 1.2e7

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

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

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

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

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

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

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

        \[\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*99.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-def99.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-udef99.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. *-commutative99.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-def99.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-def99.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-rr99.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. Step-by-step derivation
      1. clear-num99.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e7 < F

    1. Initial program 46.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00014:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.58 \cdot 10^{-108}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-101}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-58}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 12000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 12: 84.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -4.1 \cdot 10^{-108}:\\
\;\;\;\;t_0 \cdot \left(F \cdot \sqrt{0.5}\right)\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{-102}:\\
\;\;\;\;t_1 + \frac{F}{\sin B} \cdot \frac{F}{x}\\

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

\mathbf{elif}\;F \leq 12000000:\\
\;\;\;\;t_1 + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1 + t_0\\


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

    1. Initial program 56.9%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u45.5%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr45.5%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p98.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp45.1%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef45.1%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-145.1%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp40.9%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative40.9%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp45.1%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Simplified98.0%

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

    if -0.012 < F < -4.10000000000000037e-108

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr70.3%

      \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]

    if -4.10000000000000037e-108 < F < 7.5000000000000008e-102

    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. associate-*l/99.5%

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

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

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

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

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

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

        \[\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*99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5000000000000008e-102 < F < 1.8500000000000001e-58

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified85.7%

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

    if 1.8500000000000001e-58 < F < 1.2e7

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

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

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

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

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

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

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

        \[\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*99.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-def99.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-udef99.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. *-commutative99.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-def99.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-def99.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-rr99.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. Step-by-step derivation
      1. clear-num99.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e7 < F

    1. Initial program 46.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.012:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.1 \cdot 10^{-108}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-102}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \frac{F}{x}\\ \mathbf{elif}\;F \leq 1.85 \cdot 10^{-58}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 12000000:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]

Alternative 13: 70.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.039:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-108} \lor \neg \left(F \leq 2 \cdot 10^{-107}\right) \land F \leq 1.25 \cdot 10^{-57}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.039)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F -3.2e-108) (and (not (<= F 2e-107)) (<= F 1.25e-57)))
     (/ (sqrt 0.5) (/ (sin B) F))
     (+
      (* x (/ -1.0 (tan B)))
      (/ F (* B (+ F (* 0.5 (/ (+ 2.0 (* x 2.0)) F)))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.039) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= -3.2e-108) || (!(F <= 2e-107) && (F <= 1.25e-57))) {
		tmp = sqrt(0.5) / (sin(B) / F);
	} else {
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	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.039d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= (-3.2d-108)) .or. (.not. (f <= 2d-107)) .and. (f <= 1.25d-57)) then
        tmp = sqrt(0.5d0) / (sin(b) / f)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (f / (b * (f + (0.5d0 * ((2.0d0 + (x * 2.0d0)) / f)))))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.039) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= -3.2e-108) || (!(F <= 2e-107) && (F <= 1.25e-57))) {
		tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.039:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= -3.2e-108) or (not (F <= 2e-107) and (F <= 1.25e-57)):
		tmp = math.sqrt(0.5) / (math.sin(B) / F)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.039)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= -3.2e-108) || (!(F <= 2e-107) && (F <= 1.25e-57)))
		tmp = Float64(sqrt(0.5) / Float64(sin(B) / F));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(B * Float64(F + Float64(0.5 * Float64(Float64(2.0 + Float64(x * 2.0)) / F))))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.039)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= -3.2e-108) || (~((F <= 2e-107)) && (F <= 1.25e-57)))
		tmp = sqrt(0.5) / (sin(B) / F);
	else
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.039], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -3.2e-108], And[N[Not[LessEqual[F, 2e-107]], $MachinePrecision], LessEqual[F, 1.25e-57]]], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(B * N[(F + N[(0.5 * N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -3.2 \cdot 10^{-108} \lor \neg \left(F \leq 2 \cdot 10^{-107}\right) \land F \leq 1.25 \cdot 10^{-57}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\

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


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

    1. Initial program 56.9%

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

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

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

    if -0.0389999999999999999 < F < -3.2e-108 or 2e-107 < F < 1.25e-57

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified73.5%

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

    if -3.2e-108 < F < 2e-107 or 1.25e-57 < F

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

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

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

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

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

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

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

        \[\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*84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.039:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-108} \lor \neg \left(F \leq 2 \cdot 10^{-107}\right) \land F \leq 1.25 \cdot 10^{-57}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \]

Alternative 14: 70.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.02 \cdot 10^{-108}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 6.2 \cdot 10^{-59}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 56.9%

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

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

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

    if -0.0820000000000000034 < F < -1.02000000000000008e-108 or 1.3500000000000001e-101 < F < 6.19999999999999998e-59

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified73.5%

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

    if -1.02000000000000008e-108 < F < 1.3500000000000001e-101

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in F around 0 86.0%

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

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

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

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

    if 6.19999999999999998e-59 < F

    1. Initial program 57.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/74.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. +-commutative74.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. *-commutative74.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-udef74.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-def74.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-eval74.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-eval74.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*74.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-def74.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-udef74.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. *-commutative74.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-def74.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-def74.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-rr74.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. Step-by-step derivation
      1. clear-num74.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.082:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.02 \cdot 10^{-108}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-101}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-59}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \]

Alternative 15: 70.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.32 \cdot 10^{-108}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 1.02 \cdot 10^{-57}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 56.9%

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

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

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

    if -0.0054999999999999997 < F < -1.31999999999999996e-108 or 1.2199999999999999e-101 < F < 1.02e-57

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified73.5%

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

    if -1.31999999999999996e-108 < F < 1.2199999999999999e-101

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in F around 0 86.0%

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

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

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

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

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

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

    if 1.02e-57 < F

    1. Initial program 57.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/74.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. +-commutative74.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. *-commutative74.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-udef74.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-def74.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-eval74.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-eval74.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*74.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-def74.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-udef74.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. *-commutative74.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-def74.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-def74.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-rr74.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. Step-by-step derivation
      1. clear-num74.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0055:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.32 \cdot 10^{-108}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{elif}\;F \leq 1.22 \cdot 10^{-101}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 1.02 \cdot 10^{-57}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \]

Alternative 16: 70.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.36:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.9 \cdot 10^{-108}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-101}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{-58}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.36)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -3.9e-108)
     (* (/ 1.0 (sin B)) (* F (sqrt 0.5)))
     (if (<= F 1.35e-101)
       (/ (* (- x) (cos B)) (sin B))
       (if (<= F 5.3e-58)
         (/ (sqrt 0.5) (/ (sin B) F))
         (+
          (* x (/ -1.0 (tan B)))
          (/ F (* B (+ F (* 0.5 (/ (+ 2.0 (* x 2.0)) F)))))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.36) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -3.9e-108) {
		tmp = (1.0 / sin(B)) * (F * sqrt(0.5));
	} else if (F <= 1.35e-101) {
		tmp = (-x * cos(B)) / sin(B);
	} else if (F <= 5.3e-58) {
		tmp = sqrt(0.5) / (sin(B) / F);
	} else {
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	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.36d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-3.9d-108)) then
        tmp = (1.0d0 / sin(b)) * (f * sqrt(0.5d0))
    else if (f <= 1.35d-101) then
        tmp = (-x * cos(b)) / sin(b)
    else if (f <= 5.3d-58) then
        tmp = sqrt(0.5d0) / (sin(b) / f)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (f / (b * (f + (0.5d0 * ((2.0d0 + (x * 2.0d0)) / f)))))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.36) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -3.9e-108) {
		tmp = (1.0 / Math.sin(B)) * (F * Math.sqrt(0.5));
	} else if (F <= 1.35e-101) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else if (F <= 5.3e-58) {
		tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.36:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -3.9e-108:
		tmp = (1.0 / math.sin(B)) * (F * math.sqrt(0.5))
	elif F <= 1.35e-101:
		tmp = (-x * math.cos(B)) / math.sin(B)
	elif F <= 5.3e-58:
		tmp = math.sqrt(0.5) / (math.sin(B) / F)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.36)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -3.9e-108)
		tmp = Float64(Float64(1.0 / sin(B)) * Float64(F * sqrt(0.5)));
	elseif (F <= 1.35e-101)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	elseif (F <= 5.3e-58)
		tmp = Float64(sqrt(0.5) / Float64(sin(B) / F));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(B * Float64(F + Float64(0.5 * Float64(Float64(2.0 + Float64(x * 2.0)) / F))))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.36)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -3.9e-108)
		tmp = (1.0 / sin(B)) * (F * sqrt(0.5));
	elseif (F <= 1.35e-101)
		tmp = (-x * cos(B)) / sin(B);
	elseif (F <= 5.3e-58)
		tmp = sqrt(0.5) / (sin(B) / F);
	else
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.9e-108], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e-101], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.3e-58], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(B * N[(F + N[(0.5 * N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -3.9 \cdot 10^{-108}:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\

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

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

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


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

    1. Initial program 56.9%

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

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

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

    if -0.35999999999999999 < F < -3.89999999999999995e-108

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr70.3%

      \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]

    if -3.89999999999999995e-108 < F < 1.3500000000000001e-101

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in F around 0 86.0%

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

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

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

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

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

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

    if 1.3500000000000001e-101 < F < 5.3000000000000003e-58

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified85.7%

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

    if 5.3000000000000003e-58 < F

    1. Initial program 57.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/74.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. +-commutative74.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. *-commutative74.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-udef74.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-def74.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-eval74.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-eval74.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*74.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-def74.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-udef74.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. *-commutative74.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-def74.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-def74.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-rr74.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. Step-by-step derivation
      1. clear-num74.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.36:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.9 \cdot 10^{-108}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-101}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{-58}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \]

Alternative 17: 77.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.0014:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.02 \cdot 10^{-108}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-103}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.0014)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F -1.02e-108)
     (* (/ 1.0 (sin B)) (* F (sqrt 0.5)))
     (if (<= F 1.7e-103)
       (/ (* (- x) (cos B)) (sin B))
       (if (<= F 6.9e-62)
         (/ (sqrt 0.5) (/ (sin B) F))
         (+
          (* x (/ -1.0 (tan B)))
          (/ F (* B (+ F (* 0.5 (/ (+ 2.0 (* x 2.0)) F)))))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0014) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -1.02e-108) {
		tmp = (1.0 / sin(B)) * (F * sqrt(0.5));
	} else if (F <= 1.7e-103) {
		tmp = (-x * cos(B)) / sin(B);
	} else if (F <= 6.9e-62) {
		tmp = sqrt(0.5) / (sin(B) / F);
	} else {
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	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.0014d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-1.02d-108)) then
        tmp = (1.0d0 / sin(b)) * (f * sqrt(0.5d0))
    else if (f <= 1.7d-103) then
        tmp = (-x * cos(b)) / sin(b)
    else if (f <= 6.9d-62) then
        tmp = sqrt(0.5d0) / (sin(b) / f)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (f / (b * (f + (0.5d0 * ((2.0d0 + (x * 2.0d0)) / f)))))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0014) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -1.02e-108) {
		tmp = (1.0 / Math.sin(B)) * (F * Math.sqrt(0.5));
	} else if (F <= 1.7e-103) {
		tmp = (-x * Math.cos(B)) / Math.sin(B);
	} else if (F <= 6.9e-62) {
		tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.0014:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -1.02e-108:
		tmp = (1.0 / math.sin(B)) * (F * math.sqrt(0.5))
	elif F <= 1.7e-103:
		tmp = (-x * math.cos(B)) / math.sin(B)
	elif F <= 6.9e-62:
		tmp = math.sqrt(0.5) / (math.sin(B) / F)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.0014)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -1.02e-108)
		tmp = Float64(Float64(1.0 / sin(B)) * Float64(F * sqrt(0.5)));
	elseif (F <= 1.7e-103)
		tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B));
	elseif (F <= 6.9e-62)
		tmp = Float64(sqrt(0.5) / Float64(sin(B) / F));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(B * Float64(F + Float64(0.5 * Float64(Float64(2.0 + Float64(x * 2.0)) / F))))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.0014)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -1.02e-108)
		tmp = (1.0 / sin(B)) * (F * sqrt(0.5));
	elseif (F <= 1.7e-103)
		tmp = (-x * cos(B)) / sin(B);
	elseif (F <= 6.9e-62)
		tmp = sqrt(0.5) / (sin(B) / F);
	else
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.0014], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.02e-108], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-103], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.9e-62], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(B * N[(F + N[(0.5 * N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.02 \cdot 10^{-108}:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\

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

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

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


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

    1. Initial program 56.9%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u45.5%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-145.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def45.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr45.5%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p98.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp45.1%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef45.1%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-145.1%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp40.9%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative40.9%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp45.1%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      10. unsub-neg98.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Simplified98.0%

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

    if -0.00139999999999999999 < F < -1.02000000000000008e-108

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right)} \cdot \frac{1}{\sin B} \]
    7. Applied egg-rr70.3%

      \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{\sin B}} \]

    if -1.02000000000000008e-108 < F < 1.70000000000000001e-103

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in F around 0 86.0%

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

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

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

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

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

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

    if 1.70000000000000001e-103 < F < 6.89999999999999958e-62

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{\sin B}{F}}} \]
    7. Simplified85.7%

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

    if 6.89999999999999958e-62 < F

    1. Initial program 57.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. associate-*l/74.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. +-commutative74.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. *-commutative74.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-udef74.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-def74.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-eval74.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-eval74.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*74.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-def74.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-udef74.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. *-commutative74.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-def74.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-def74.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-rr74.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. Step-by-step derivation
      1. clear-num74.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0014:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.02 \cdot 10^{-108}:\\ \;\;\;\;\frac{1}{\sin B} \cdot \left(F \cdot \sqrt{0.5}\right)\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-103}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \]

Alternative 18: 63.6% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \leq -4.5 \cdot 10^{-145}:\\
\;\;\;\;\left(0.3333333333333333 \cdot \left(B \cdot x\right) + t_1 \cdot \frac{F}{B}\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.65 \cdot 10^{-307}:\\
\;\;\;\;t_0 + \frac{F}{B} \cdot \frac{-1}{F}\\

\mathbf{elif}\;F \leq 2.35 \cdot 10^{-138}:\\
\;\;\;\;\frac{F \cdot t_1 - x}{B}\\

\mathbf{elif}\;F \leq 0.0235:\\
\;\;\;\;t_0 + \frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -0.23499999999999999

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 79.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -0.23499999999999999 < F < -4.5000000000000001e-145

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.6%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.6%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around 0 99.1%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 65.9%

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in B around 0 49.9%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \sqrt{\frac{1}{2 + 2 \cdot x}} \cdot \frac{F}{B}\right) - \frac{x}{B}} \]

    if -4.5000000000000001e-145 < F < -1.65e-307

    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 31.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{-1}{F}} \]
    3. Taylor expanded in B around 0 60.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]

    if -1.65e-307 < F < 2.3500000000000001e-138

    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. Step-by-step derivation
      1. +-commutative99.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 F around 0 99.9%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 74.1%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B}} \]

    if 2.3500000000000001e-138 < F < 0.0235

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 40.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 54.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if 0.0235 < F

    1. Initial program 47.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 32.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 83.4%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification71.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.235:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-145}:\\ \;\;\;\;\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.65 \cdot 10^{-307}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{-138}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 0.0235:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 19: 71.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 + x \cdot 2\\ \mathbf{if}\;F \leq -0.235:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.4 \cdot 10^{-109}:\\ \;\;\;\;\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \sqrt{\frac{1}{t_0}} \cdot \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{t_0}{F}\right)}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (+ 2.0 (* x 2.0))))
   (if (<= F -0.235)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -3.4e-109)
       (-
        (+ (* 0.3333333333333333 (* B x)) (* (sqrt (/ 1.0 t_0)) (/ F B)))
        (/ x B))
       (+ (* x (/ -1.0 (tan B))) (/ F (* B (+ F (* 0.5 (/ t_0 F))))))))))
double code(double F, double B, double x) {
	double t_0 = 2.0 + (x * 2.0);
	double tmp;
	if (F <= -0.235) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -3.4e-109) {
		tmp = ((0.3333333333333333 * (B * x)) + (sqrt((1.0 / t_0)) * (F / B))) - (x / B);
	} else {
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * (t_0 / F)))));
	}
	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 = 2.0d0 + (x * 2.0d0)
    if (f <= (-0.235d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-3.4d-109)) then
        tmp = ((0.3333333333333333d0 * (b * x)) + (sqrt((1.0d0 / t_0)) * (f / b))) - (x / b)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (f / (b * (f + (0.5d0 * (t_0 / f)))))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = 2.0 + (x * 2.0);
	double tmp;
	if (F <= -0.235) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -3.4e-109) {
		tmp = ((0.3333333333333333 * (B * x)) + (Math.sqrt((1.0 / t_0)) * (F / B))) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (F / (B * (F + (0.5 * (t_0 / F)))));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = 2.0 + (x * 2.0)
	tmp = 0
	if F <= -0.235:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -3.4e-109:
		tmp = ((0.3333333333333333 * (B * x)) + (math.sqrt((1.0 / t_0)) * (F / B))) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (F / (B * (F + (0.5 * (t_0 / F)))))
	return tmp
function code(F, B, x)
	t_0 = Float64(2.0 + Float64(x * 2.0))
	tmp = 0.0
	if (F <= -0.235)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -3.4e-109)
		tmp = Float64(Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(sqrt(Float64(1.0 / t_0)) * Float64(F / B))) - Float64(x / B));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(B * Float64(F + Float64(0.5 * Float64(t_0 / F))))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = 2.0 + (x * 2.0);
	tmp = 0.0;
	if (F <= -0.235)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -3.4e-109)
		tmp = ((0.3333333333333333 * (B * x)) + (sqrt((1.0 / t_0)) * (F / B))) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * (t_0 / F)))));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.235], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.4e-109], N[(N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(B * N[(F + N[(0.5 * N[(t$95$0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 2 + x \cdot 2\\
\mathbf{if}\;F \leq -0.235:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -3.4 \cdot 10^{-109}:\\
\;\;\;\;\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \sqrt{\frac{1}{t_0}} \cdot \frac{F}{B}\right) - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{t_0}{F}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -0.23499999999999999

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 79.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -0.23499999999999999 < F < -3.40000000000000012e-109

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 0 99.1%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 68.0%

      \[\leadsto \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in B around 0 53.2%

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \sqrt{\frac{1}{2 + 2 \cdot x}} \cdot \frac{F}{B}\right) - \frac{x}{B}} \]

    if -3.40000000000000012e-109 < F

    1. Initial program 75.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/85.2%

        \[\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. +-commutative85.2%

        \[\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. *-commutative85.2%

        \[\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-udef85.2%

        \[\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-def85.2%

        \[\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-eval85.2%

        \[\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-eval85.2%

        \[\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*85.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-def85.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-udef85.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. *-commutative85.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-def85.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-def85.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-rr85.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. Step-by-step derivation
      1. clear-num85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}{F}}} \]
      2. inv-pow85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\frac{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}{F}\right)}^{-1}} \]
      3. div-inv85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}{F}\right)}^{-1} \]
      4. pow-flip85.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}{F}\right)}^{-1} \]
      5. metadata-eval85.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}{F}\right)}^{-1} \]
      6. pow1/285.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\sin B \cdot \color{blue}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{F}\right)}^{-1} \]
    5. Applied egg-rr85.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\frac{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-185.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}}} \]
      2. associate-/l*85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\frac{\sin B}{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}}} \]
    7. Simplified85.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B}{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}}} \]
    8. Taylor expanded in F around inf 86.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\color{blue}{F + 0.5 \cdot \frac{2 \cdot x + 2}{F}}}}} \]
    9. Taylor expanded in B around 0 78.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\left(F + 0.5 \cdot \frac{2 \cdot x + 2}{F}\right) \cdot B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.235:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.4 \cdot 10^{-109}:\\ \;\;\;\;\left(0.3333333333333333 \cdot \left(B \cdot x\right) + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \]

Alternative 20: 71.3% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -430:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-110}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -430.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -2.7e-110)
     (- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
     (+
      (* x (/ -1.0 (tan B)))
      (/ F (* B (+ F (* 0.5 (/ (+ 2.0 (* x 2.0)) F)))))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -430.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.7e-110) {
		tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
	} else {
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	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 <= (-430.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.7d-110)) then
        tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
    else
        tmp = (x * ((-1.0d0) / tan(b))) + (f / (b * (f + (0.5d0 * ((2.0d0 + (x * 2.0d0)) / f)))))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -430.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.7e-110) {
		tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -430.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.7e-110:
		tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -430.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.7e-110)
		tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(B * Float64(F + Float64(0.5 * Float64(Float64(2.0 + Float64(x * 2.0)) / F))))));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -430.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.7e-110)
		tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (F / (B * (F + (0.5 * ((2.0 + (x * 2.0)) / F)))));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -430.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.7e-110], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(B * N[(F + N[(0.5 * N[(N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -430:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.7 \cdot 10^{-110}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -430

    1. Initial program 56.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 98.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 80.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -430 < F < -2.6999999999999998e-110

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 82.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in B around 0 55.3%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

    if -2.6999999999999998e-110 < F

    1. Initial program 75.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/85.2%

        \[\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. +-commutative85.2%

        \[\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. *-commutative85.2%

        \[\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-udef85.2%

        \[\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-def85.2%

        \[\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-eval85.2%

        \[\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-eval85.2%

        \[\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*85.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-def85.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-udef85.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. *-commutative85.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-def85.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-def85.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-rr85.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. Step-by-step derivation
      1. clear-num85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}{F}}} \]
      2. inv-pow85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\frac{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}{F}\right)}^{-1}} \]
      3. div-inv85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\color{blue}{\sin B \cdot \frac{1}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}}{F}\right)}^{-1} \]
      4. pow-flip85.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\sin B \cdot \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(--0.5\right)}}}{F}\right)}^{-1} \]
      5. metadata-eval85.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\sin B \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{0.5}}}{F}\right)}^{-1} \]
      6. pow1/285.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + {\left(\frac{\sin B \cdot \color{blue}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{F}\right)}^{-1} \]
    5. Applied egg-rr85.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\frac{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-185.2%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}}} \]
      2. associate-/l*85.1%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\color{blue}{\frac{\sin B}{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}}} \]
    7. Simplified85.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\frac{\sin B}{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}}} \]
    8. Taylor expanded in F around inf 86.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\frac{\sin B}{\frac{F}{\color{blue}{F + 0.5 \cdot \frac{2 \cdot x + 2}{F}}}}} \]
    9. Taylor expanded in B around 0 78.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{\left(F + 0.5 \cdot \frac{2 \cdot x + 2}{F}\right) \cdot B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -430:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-110}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B \cdot \left(F + 0.5 \cdot \frac{2 + x \cdot 2}{F}\right)}\\ \end{array} \]

Alternative 21: 63.1% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ t_1 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{if}\;F \leq -0.06:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-147}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -3.8 \cdot 10^{-308}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-138}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 0.49:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\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))
        (t_1 (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))))
   (if (<= F -0.06)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -9.5e-147)
       t_0
       (if (<= F -3.8e-308)
         t_1
         (if (<= F 1.1e-138)
           t_0
           (if (<= F 0.49) t_1 (- (/ 1.0 (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 t_1 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	double tmp;
	if (F <= -0.06) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -9.5e-147) {
		tmp = t_0;
	} else if (F <= -3.8e-308) {
		tmp = t_1;
	} else if (F <= 1.1e-138) {
		tmp = t_0;
	} else if (F <= 0.49) {
		tmp = t_1;
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    t_1 = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    if (f <= (-0.06d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-9.5d-147)) then
        tmp = t_0
    else if (f <= (-3.8d-308)) then
        tmp = t_1
    else if (f <= 1.1d-138) then
        tmp = t_0
    else if (f <= 0.49d0) then
        tmp = t_1
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double t_1 = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	double tmp;
	if (F <= -0.06) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -9.5e-147) {
		tmp = t_0;
	} else if (F <= -3.8e-308) {
		tmp = t_1;
	} else if (F <= 1.1e-138) {
		tmp = t_0;
	} else if (F <= 0.49) {
		tmp = t_1;
	} else {
		tmp = (1.0 / 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
	t_1 = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	tmp = 0
	if F <= -0.06:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -9.5e-147:
		tmp = t_0
	elif F <= -3.8e-308:
		tmp = t_1
	elif F <= 1.1e-138:
		tmp = t_0
	elif F <= 0.49:
		tmp = t_1
	else:
		tmp = (1.0 / 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)
	t_1 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B))
	tmp = 0.0
	if (F <= -0.06)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -9.5e-147)
		tmp = t_0;
	elseif (F <= -3.8e-308)
		tmp = t_1;
	elseif (F <= 1.1e-138)
		tmp = t_0;
	elseif (F <= 0.49)
		tmp = t_1;
	else
		tmp = Float64(Float64(1.0 / 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;
	t_1 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	tmp = 0.0;
	if (F <= -0.06)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -9.5e-147)
		tmp = t_0;
	elseif (F <= -3.8e-308)
		tmp = t_1;
	elseif (F <= 1.1e-138)
		tmp = t_0;
	elseif (F <= 0.49)
		tmp = t_1;
	else
		tmp = (1.0 / 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]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.06], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.5e-147], t$95$0, If[LessEqual[F, -3.8e-308], t$95$1, If[LessEqual[F, 1.1e-138], t$95$0, If[LessEqual[F, 0.49], t$95$1, N[(N[(1.0 / N[Sin[B], $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}\\
t_1 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{if}\;F \leq -0.06:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -9.5 \cdot 10^{-147}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -3.8 \cdot 10^{-308}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-138}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 0.49:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -0.059999999999999998

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 79.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -0.059999999999999998 < F < -9.49999999999999986e-147 or -3.79999999999999975e-308 < F < 1.0999999999999999e-138

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 60.0%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B}} \]

    if -9.49999999999999986e-147 < F < -3.79999999999999975e-308 or 1.0999999999999999e-138 < F < 0.48999999999999999

    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.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 56.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if 0.48999999999999999 < F

    1. Initial program 47.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 32.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 83.4%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification71.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.06:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.5 \cdot 10^{-147}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq -3.8 \cdot 10^{-308}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-138}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 0.49:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 22: 63.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ t_1 := x \cdot \frac{-1}{\tan B}\\ \mathbf{if}\;F \leq -0.22:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{-145}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -2.2 \cdot 10^{-308}:\\ \;\;\;\;t_1 + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-138}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 0.0275:\\ \;\;\;\;t_1 + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\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))
        (t_1 (* x (/ -1.0 (tan B)))))
   (if (<= F -0.22)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -1.15e-145)
       t_0
       (if (<= F -2.2e-308)
         (+ t_1 (* (/ F B) (/ -1.0 F)))
         (if (<= F 1.3e-138)
           t_0
           (if (<= F 0.0275)
             (+ t_1 (/ -1.0 B))
             (- (/ 1.0 (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 t_1 = x * (-1.0 / tan(B));
	double tmp;
	if (F <= -0.22) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.15e-145) {
		tmp = t_0;
	} else if (F <= -2.2e-308) {
		tmp = t_1 + ((F / B) * (-1.0 / F));
	} else if (F <= 1.3e-138) {
		tmp = t_0;
	} else if (F <= 0.0275) {
		tmp = t_1 + (-1.0 / B);
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    t_1 = x * ((-1.0d0) / tan(b))
    if (f <= (-0.22d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.15d-145)) then
        tmp = t_0
    else if (f <= (-2.2d-308)) then
        tmp = t_1 + ((f / b) * ((-1.0d0) / f))
    else if (f <= 1.3d-138) then
        tmp = t_0
    else if (f <= 0.0275d0) then
        tmp = t_1 + ((-1.0d0) / b)
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	double t_1 = x * (-1.0 / Math.tan(B));
	double tmp;
	if (F <= -0.22) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.15e-145) {
		tmp = t_0;
	} else if (F <= -2.2e-308) {
		tmp = t_1 + ((F / B) * (-1.0 / F));
	} else if (F <= 1.3e-138) {
		tmp = t_0;
	} else if (F <= 0.0275) {
		tmp = t_1 + (-1.0 / B);
	} else {
		tmp = (1.0 / 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
	t_1 = x * (-1.0 / math.tan(B))
	tmp = 0
	if F <= -0.22:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.15e-145:
		tmp = t_0
	elif F <= -2.2e-308:
		tmp = t_1 + ((F / B) * (-1.0 / F))
	elif F <= 1.3e-138:
		tmp = t_0
	elif F <= 0.0275:
		tmp = t_1 + (-1.0 / B)
	else:
		tmp = (1.0 / 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)
	t_1 = Float64(x * Float64(-1.0 / tan(B)))
	tmp = 0.0
	if (F <= -0.22)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.15e-145)
		tmp = t_0;
	elseif (F <= -2.2e-308)
		tmp = Float64(t_1 + Float64(Float64(F / B) * Float64(-1.0 / F)));
	elseif (F <= 1.3e-138)
		tmp = t_0;
	elseif (F <= 0.0275)
		tmp = Float64(t_1 + Float64(-1.0 / B));
	else
		tmp = Float64(Float64(1.0 / 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;
	t_1 = x * (-1.0 / tan(B));
	tmp = 0.0;
	if (F <= -0.22)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.15e-145)
		tmp = t_0;
	elseif (F <= -2.2e-308)
		tmp = t_1 + ((F / B) * (-1.0 / F));
	elseif (F <= 1.3e-138)
		tmp = t_0;
	elseif (F <= 0.0275)
		tmp = t_1 + (-1.0 / B);
	else
		tmp = (1.0 / 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]}, Block[{t$95$1 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.15e-145], t$95$0, If[LessEqual[F, -2.2e-308], N[(t$95$1 + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e-138], t$95$0, If[LessEqual[F, 0.0275], N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $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}\\
t_1 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -0.22:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.15 \cdot 10^{-145}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -2.2 \cdot 10^{-308}:\\
\;\;\;\;t_1 + \frac{F}{B} \cdot \frac{-1}{F}\\

\mathbf{elif}\;F \leq 1.3 \cdot 10^{-138}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 0.0275:\\
\;\;\;\;t_1 + \frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -0.220000000000000001

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 79.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -0.220000000000000001 < F < -1.15000000000000004e-145 or -2.2000000000000002e-308 < F < 1.3e-138

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.6%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 60.0%

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B}} \]

    if -1.15000000000000004e-145 < F < -2.2000000000000002e-308

    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 31.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{-1}{F}} \]
    3. Taylor expanded in B around 0 60.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]

    if 1.3e-138 < F < 0.0275000000000000001

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 40.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 54.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if 0.0275000000000000001 < F

    1. Initial program 47.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 32.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 83.4%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification71.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.22:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.15 \cdot 10^{-145}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq -2.2 \cdot 10^{-308}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-138}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 0.0275:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 23: 60.9% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{if}\;F \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-305}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.36 \cdot 10^{-139}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.28 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))))
   (if (<= F -1.3e-5)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (<= F -1.08e-29)
       (/ (sqrt 0.5) (/ B F))
       (if (<= F -5.2e-305)
         t_0
         (if (<= F 1.36e-139)
           (/ (- x) B)
           (if (<= F 1.28e-5) t_0 (- (/ 1.0 (sin B)) (/ x B)))))))))
double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	double tmp;
	if (F <= -1.3e-5) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.08e-29) {
		tmp = sqrt(0.5) / (B / F);
	} else if (F <= -5.2e-305) {
		tmp = t_0;
	} else if (F <= 1.36e-139) {
		tmp = -x / B;
	} else if (F <= 1.28e-5) {
		tmp = t_0;
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    if (f <= (-1.3d-5)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.08d-29)) then
        tmp = sqrt(0.5d0) / (b / f)
    else if (f <= (-5.2d-305)) then
        tmp = t_0
    else if (f <= 1.36d-139) then
        tmp = -x / b
    else if (f <= 1.28d-5) then
        tmp = t_0
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	double tmp;
	if (F <= -1.3e-5) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.08e-29) {
		tmp = Math.sqrt(0.5) / (B / F);
	} else if (F <= -5.2e-305) {
		tmp = t_0;
	} else if (F <= 1.36e-139) {
		tmp = -x / B;
	} else if (F <= 1.28e-5) {
		tmp = t_0;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	tmp = 0
	if F <= -1.3e-5:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.08e-29:
		tmp = math.sqrt(0.5) / (B / F)
	elif F <= -5.2e-305:
		tmp = t_0
	elif F <= 1.36e-139:
		tmp = -x / B
	elif F <= 1.28e-5:
		tmp = t_0
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B))
	tmp = 0.0
	if (F <= -1.3e-5)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.08e-29)
		tmp = Float64(sqrt(0.5) / Float64(B / F));
	elseif (F <= -5.2e-305)
		tmp = t_0;
	elseif (F <= 1.36e-139)
		tmp = Float64(Float64(-x) / B);
	elseif (F <= 1.28e-5)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	tmp = 0.0;
	if (F <= -1.3e-5)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.08e-29)
		tmp = sqrt(0.5) / (B / F);
	elseif (F <= -5.2e-305)
		tmp = t_0;
	elseif (F <= 1.36e-139)
		tmp = -x / B;
	elseif (F <= 1.28e-5)
		tmp = t_0;
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.3e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.08e-29], N[(N[Sqrt[0.5], $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.2e-305], t$95$0, If[LessEqual[F, 1.36e-139], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 1.28e-5], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.08 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}}\\

\mathbf{elif}\;F \leq -5.2 \cdot 10^{-305}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.36 \cdot 10^{-139}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{elif}\;F \leq 1.28 \cdot 10^{-5}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -1.29999999999999992e-5

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 79.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -1.29999999999999992e-5 < F < -1.07999999999999995e-29

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.4%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.2%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Taylor expanded in F around 0 98.1%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in x around 0 92.4%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{\sin B}} \]
    6. Taylor expanded in B around 0 50.1%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{B}} \]
    7. Step-by-step derivation
      1. associate-/l*50.1%

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} \]
    8. Simplified50.1%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} \]

    if -1.07999999999999995e-29 < F < -5.2000000000000003e-305 or 1.36000000000000003e-139 < F < 1.2799999999999999e-5

    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 B around 0 51.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]

    if -5.2000000000000003e-305 < F < 1.36000000000000003e-139

    1. Initial program 99.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 30.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 27.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/27.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in27.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval27.9%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-127.9%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified27.9%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 63.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/63.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg63.6%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified63.6%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.2799999999999999e-5 < F

    1. Initial program 47.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 32.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 83.4%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification69.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.08 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq -5.2 \cdot 10^{-305}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.36 \cdot 10^{-139}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{elif}\;F \leq 1.28 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 24: 57.6% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.0019:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1 \cdot 10^{-110}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-30}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.0019)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -1e-110)
     (/ (* F (sqrt 0.5)) B)
     (if (<= F 1.4e-30) (/ (- x) B) (- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0019) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1e-110) {
		tmp = (F * sqrt(0.5)) / B;
	} else if (F <= 1.4e-30) {
		tmp = -x / B;
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.0019d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1d-110)) then
        tmp = (f * sqrt(0.5d0)) / b
    else if (f <= 1.4d-30) then
        tmp = -x / b
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0019) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1e-110) {
		tmp = (F * Math.sqrt(0.5)) / B;
	} else if (F <= 1.4e-30) {
		tmp = -x / B;
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.0019:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1e-110:
		tmp = (F * math.sqrt(0.5)) / B
	elif F <= 1.4e-30:
		tmp = -x / B
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.0019)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1e-110)
		tmp = Float64(Float64(F * sqrt(0.5)) / B);
	elseif (F <= 1.4e-30)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.0019)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1e-110)
		tmp = (F * sqrt(0.5)) / B;
	elseif (F <= 1.4e-30)
		tmp = -x / B;
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.0019], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1e-110], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4e-30], N[((-x) / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0019:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1 \cdot 10^{-110}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-30}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -0.0019

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 79.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -0.0019 < F < -1.0000000000000001e-110

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 0 99.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in x around 0 67.5%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{\sin B}} \]
    6. Taylor expanded in B around 0 40.3%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{B}} \]

    if -1.0000000000000001e-110 < F < 1.39999999999999994e-30

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 30.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 16.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/16.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in16.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval16.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-116.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified16.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 38.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/38.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg38.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified38.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.39999999999999994e-30 < F

    1. Initial program 51.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 B around 0 35.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 80.2%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0019:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1 \cdot 10^{-110}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-30}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 25: 37.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.034:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-114}:\\ \;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}}\\ \mathbf{elif}\;F \leq 52000000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.034)
   (/ -1.0 (sin B))
   (if (<= F -6e-114)
     (/ F (/ B (sqrt 0.5)))
     (if (<= F 52000000000.0) (/ (- x) B) (fabs (/ (+ -1.0 x) B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.034) {
		tmp = -1.0 / sin(B);
	} else if (F <= -6e-114) {
		tmp = F / (B / sqrt(0.5));
	} else if (F <= 52000000000.0) {
		tmp = -x / B;
	} else {
		tmp = fabs(((-1.0 + x) / B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.034d0)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= (-6d-114)) then
        tmp = f / (b / sqrt(0.5d0))
    else if (f <= 52000000000.0d0) then
        tmp = -x / b
    else
        tmp = abs((((-1.0d0) + x) / b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.034) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= -6e-114) {
		tmp = F / (B / Math.sqrt(0.5));
	} else if (F <= 52000000000.0) {
		tmp = -x / B;
	} else {
		tmp = Math.abs(((-1.0 + x) / B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.034:
		tmp = -1.0 / math.sin(B)
	elif F <= -6e-114:
		tmp = F / (B / math.sqrt(0.5))
	elif F <= 52000000000.0:
		tmp = -x / B
	else:
		tmp = math.fabs(((-1.0 + x) / B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.034)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= -6e-114)
		tmp = Float64(F / Float64(B / sqrt(0.5)));
	elseif (F <= 52000000000.0)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = abs(Float64(Float64(-1.0 + x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.034)
		tmp = -1.0 / sin(B);
	elseif (F <= -6e-114)
		tmp = F / (B / sqrt(0.5));
	elseif (F <= 52000000000.0)
		tmp = -x / B;
	else
		tmp = abs(((-1.0 + x) / B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.034], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-114], N[(F / N[(B / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 52000000000.0], N[((-x) / B), $MachinePrecision], N[Abs[N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.034:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq -6 \cdot 10^{-114}:\\
\;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}}\\

\mathbf{elif}\;F \leq 52000000000:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{-1 + x}{B}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -0.034000000000000002

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 65.5%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{-1}{\sin B} \]
    4. Step-by-step derivation
      1. *-commutative65.5%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{-1}{\sin B} \]
    5. Simplified65.5%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)}\right) + \frac{-1}{\sin B} \]
    6. Taylor expanded in x around 0 60.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -0.034000000000000002 < F < -6.0000000000000003e-114

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 0 99.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in x around 0 67.5%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{\sin B}} \]
    6. Taylor expanded in B around 0 40.3%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{B}} \]
    7. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{0.5}}}{B} \]
      2. associate-/l*40.2%

        \[\leadsto \color{blue}{\frac{F}{\frac{B}{\sqrt{0.5}}}} \]
    8. Simplified40.2%

      \[\leadsto \color{blue}{\frac{F}{\frac{B}{\sqrt{0.5}}}} \]

    if -6.0000000000000003e-114 < F < 5.2e10

    1. Initial program 98.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 33.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 20.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/20.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in20.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval20.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-120.4%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified20.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 39.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/39.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg39.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified39.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 5.2e10 < F

    1. Initial program 45.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 40.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 25.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/25.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified25.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt11.7%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B}} \cdot \sqrt{\frac{-1 + \left(-x\right)}{B}}} \]
      2. sqrt-unprod18.3%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B} \cdot \frac{-1 + \left(-x\right)}{B}}} \]
      3. pow218.3%

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{-1 + \left(-x\right)}{B}\right)}^{2}}} \]
      4. +-commutative18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\left(-x\right) + -1}}{B}\right)}^{2}} \]
      5. add-sqr-sqrt8.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}} + -1}{B}\right)}^{2}} \]
      6. sqrt-unprod18.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} + -1}{B}\right)}^{2}} \]
      7. sqr-neg18.4%

        \[\leadsto \sqrt{{\left(\frac{\sqrt{\color{blue}{x \cdot x}} + -1}{B}\right)}^{2}} \]
      8. sqrt-unprod9.9%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}} + -1}{B}\right)}^{2}} \]
      9. add-sqr-sqrt18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{x} + -1}{B}\right)}^{2}} \]
    7. Applied egg-rr18.3%

      \[\leadsto \color{blue}{\sqrt{{\left(\frac{x + -1}{B}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. unpow218.3%

        \[\leadsto \sqrt{\color{blue}{\frac{x + -1}{B} \cdot \frac{x + -1}{B}}} \]
      2. rem-sqrt-square39.7%

        \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
    9. Simplified39.7%

      \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.034:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-114}:\\ \;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}}\\ \mathbf{elif}\;F \leq 52000000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \]

Alternative 26: 37.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.112:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{-110}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 39000000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.112)
   (/ -1.0 (sin B))
   (if (<= F -1.35e-110)
     (/ (* F (sqrt 0.5)) B)
     (if (<= F 39000000000.0) (/ (- x) B) (fabs (/ (+ -1.0 x) B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.112) {
		tmp = -1.0 / sin(B);
	} else if (F <= -1.35e-110) {
		tmp = (F * sqrt(0.5)) / B;
	} else if (F <= 39000000000.0) {
		tmp = -x / B;
	} else {
		tmp = fabs(((-1.0 + x) / B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.112d0)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= (-1.35d-110)) then
        tmp = (f * sqrt(0.5d0)) / b
    else if (f <= 39000000000.0d0) then
        tmp = -x / b
    else
        tmp = abs((((-1.0d0) + x) / b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.112) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= -1.35e-110) {
		tmp = (F * Math.sqrt(0.5)) / B;
	} else if (F <= 39000000000.0) {
		tmp = -x / B;
	} else {
		tmp = Math.abs(((-1.0 + x) / B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.112:
		tmp = -1.0 / math.sin(B)
	elif F <= -1.35e-110:
		tmp = (F * math.sqrt(0.5)) / B
	elif F <= 39000000000.0:
		tmp = -x / B
	else:
		tmp = math.fabs(((-1.0 + x) / B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.112)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= -1.35e-110)
		tmp = Float64(Float64(F * sqrt(0.5)) / B);
	elseif (F <= 39000000000.0)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = abs(Float64(Float64(-1.0 + x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.112)
		tmp = -1.0 / sin(B);
	elseif (F <= -1.35e-110)
		tmp = (F * sqrt(0.5)) / B;
	elseif (F <= 39000000000.0)
		tmp = -x / B;
	else
		tmp = abs(((-1.0 + x) / B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.112], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.35e-110], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 39000000000.0], N[((-x) / B), $MachinePrecision], N[Abs[N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.112:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq -1.35 \cdot 10^{-110}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\

\mathbf{elif}\;F \leq 39000000000:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{-1 + x}{B}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -0.112000000000000002

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 65.5%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{-1}{\sin B} \]
    4. Step-by-step derivation
      1. *-commutative65.5%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{-1}{\sin B} \]
    5. Simplified65.5%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)}\right) + \frac{-1}{\sin B} \]
    6. Taylor expanded in x around 0 60.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -0.112000000000000002 < F < -1.3499999999999999e-110

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 0 99.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in x around 0 67.5%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{\sin B}} \]
    6. Taylor expanded in B around 0 40.3%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{B}} \]

    if -1.3499999999999999e-110 < F < 3.9e10

    1. Initial program 98.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 33.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 20.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/20.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in20.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval20.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-120.4%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified20.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 39.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/39.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg39.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified39.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 3.9e10 < F

    1. Initial program 45.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 40.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 25.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/25.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified25.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt11.7%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B}} \cdot \sqrt{\frac{-1 + \left(-x\right)}{B}}} \]
      2. sqrt-unprod18.3%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B} \cdot \frac{-1 + \left(-x\right)}{B}}} \]
      3. pow218.3%

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{-1 + \left(-x\right)}{B}\right)}^{2}}} \]
      4. +-commutative18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\left(-x\right) + -1}}{B}\right)}^{2}} \]
      5. add-sqr-sqrt8.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}} + -1}{B}\right)}^{2}} \]
      6. sqrt-unprod18.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} + -1}{B}\right)}^{2}} \]
      7. sqr-neg18.4%

        \[\leadsto \sqrt{{\left(\frac{\sqrt{\color{blue}{x \cdot x}} + -1}{B}\right)}^{2}} \]
      8. sqrt-unprod9.9%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}} + -1}{B}\right)}^{2}} \]
      9. add-sqr-sqrt18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{x} + -1}{B}\right)}^{2}} \]
    7. Applied egg-rr18.3%

      \[\leadsto \color{blue}{\sqrt{{\left(\frac{x + -1}{B}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. unpow218.3%

        \[\leadsto \sqrt{\color{blue}{\frac{x + -1}{B} \cdot \frac{x + -1}{B}}} \]
      2. rem-sqrt-square39.7%

        \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
    9. Simplified39.7%

      \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.112:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{-110}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 39000000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \]

Alternative 27: 43.8% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.0034:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1 \cdot 10^{-110}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 16500000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.0034)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -1e-110)
     (/ (* F (sqrt 0.5)) B)
     (if (<= F 16500000000.0) (/ (- x) B) (fabs (/ (+ -1.0 x) B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0034) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1e-110) {
		tmp = (F * sqrt(0.5)) / B;
	} else if (F <= 16500000000.0) {
		tmp = -x / B;
	} else {
		tmp = fabs(((-1.0 + x) / B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.0034d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1d-110)) then
        tmp = (f * sqrt(0.5d0)) / b
    else if (f <= 16500000000.0d0) then
        tmp = -x / b
    else
        tmp = abs((((-1.0d0) + x) / b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.0034) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1e-110) {
		tmp = (F * Math.sqrt(0.5)) / B;
	} else if (F <= 16500000000.0) {
		tmp = -x / B;
	} else {
		tmp = Math.abs(((-1.0 + x) / B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.0034:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1e-110:
		tmp = (F * math.sqrt(0.5)) / B
	elif F <= 16500000000.0:
		tmp = -x / B
	else:
		tmp = math.fabs(((-1.0 + x) / B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.0034)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1e-110)
		tmp = Float64(Float64(F * sqrt(0.5)) / B);
	elseif (F <= 16500000000.0)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = abs(Float64(Float64(-1.0 + x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.0034)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1e-110)
		tmp = (F * sqrt(0.5)) / B;
	elseif (F <= 16500000000.0)
		tmp = -x / B;
	else
		tmp = abs(((-1.0 + x) / B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.0034], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1e-110], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 16500000000.0], N[((-x) / B), $MachinePrecision], N[Abs[N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0034:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1 \cdot 10^{-110}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\

\mathbf{elif}\;F \leq 16500000000:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{-1 + x}{B}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -0.00339999999999999981

    1. Initial program 56.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 98.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 79.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]

    if -0.00339999999999999981 < F < -1.0000000000000001e-110

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.4%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.7%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} \cdot F} - x \cdot \frac{1}{\tan B} \]
    3. Simplified99.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 0 99.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 \cdot x + 2}}\right)} - \frac{x}{\tan B} \]
    5. Taylor expanded in x around 0 67.5%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{\sin B}} \]
    6. Taylor expanded in B around 0 40.3%

      \[\leadsto \color{blue}{\frac{\sqrt{0.5} \cdot F}{B}} \]

    if -1.0000000000000001e-110 < F < 1.65e10

    1. Initial program 98.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 33.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 20.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/20.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in20.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval20.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-120.4%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified20.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 39.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/39.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg39.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified39.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.65e10 < F

    1. Initial program 45.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 40.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 25.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/25.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified25.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt11.7%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B}} \cdot \sqrt{\frac{-1 + \left(-x\right)}{B}}} \]
      2. sqrt-unprod18.3%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B} \cdot \frac{-1 + \left(-x\right)}{B}}} \]
      3. pow218.3%

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{-1 + \left(-x\right)}{B}\right)}^{2}}} \]
      4. +-commutative18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\left(-x\right) + -1}}{B}\right)}^{2}} \]
      5. add-sqr-sqrt8.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}} + -1}{B}\right)}^{2}} \]
      6. sqrt-unprod18.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} + -1}{B}\right)}^{2}} \]
      7. sqr-neg18.4%

        \[\leadsto \sqrt{{\left(\frac{\sqrt{\color{blue}{x \cdot x}} + -1}{B}\right)}^{2}} \]
      8. sqrt-unprod9.9%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}} + -1}{B}\right)}^{2}} \]
      9. add-sqr-sqrt18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{x} + -1}{B}\right)}^{2}} \]
    7. Applied egg-rr18.3%

      \[\leadsto \color{blue}{\sqrt{{\left(\frac{x + -1}{B}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. unpow218.3%

        \[\leadsto \sqrt{\color{blue}{\frac{x + -1}{B} \cdot \frac{x + -1}{B}}} \]
      2. rem-sqrt-square39.7%

        \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
    9. Simplified39.7%

      \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0034:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1 \cdot 10^{-110}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 16500000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \]

Alternative 28: 36.5% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7400000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.2e-47)
   (/ -1.0 (sin B))
   (if (<= F 7400000000.0) (/ (- x) B) (fabs (/ (+ -1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.2e-47) {
		tmp = -1.0 / sin(B);
	} else if (F <= 7400000000.0) {
		tmp = -x / B;
	} else {
		tmp = fabs(((-1.0 + x) / B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-5.2d-47)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 7400000000.0d0) then
        tmp = -x / b
    else
        tmp = abs((((-1.0d0) + x) / b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.2e-47) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 7400000000.0) {
		tmp = -x / B;
	} else {
		tmp = Math.abs(((-1.0 + x) / B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.2e-47:
		tmp = -1.0 / math.sin(B)
	elif F <= 7400000000.0:
		tmp = -x / B
	else:
		tmp = math.fabs(((-1.0 + x) / B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.2e-47)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 7400000000.0)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = abs(Float64(Float64(-1.0 + x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.2e-47)
		tmp = -1.0 / sin(B);
	elseif (F <= 7400000000.0)
		tmp = -x / B;
	else
		tmp = abs(((-1.0 + x) / B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.2e-47], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7400000000.0], N[((-x) / B), $MachinePrecision], N[Abs[N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 7400000000:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left|\frac{-1 + x}{B}\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -5.2e-47

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 85.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 56.7%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{-1}{\sin B} \]
    4. Step-by-step derivation
      1. *-commutative56.7%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{-1}{\sin B} \]
    5. Simplified56.7%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)}\right) + \frac{-1}{\sin B} \]
    6. Taylor expanded in x around 0 53.1%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -5.2e-47 < F < 7.4e9

    1. Initial program 98.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 34.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 19.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/19.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in19.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval19.3%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-119.3%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified19.3%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 37.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/37.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg37.0%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified37.0%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 7.4e9 < F

    1. Initial program 45.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 40.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 25.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/25.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in25.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval25.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-125.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified25.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt11.7%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B}} \cdot \sqrt{\frac{-1 + \left(-x\right)}{B}}} \]
      2. sqrt-unprod18.3%

        \[\leadsto \color{blue}{\sqrt{\frac{-1 + \left(-x\right)}{B} \cdot \frac{-1 + \left(-x\right)}{B}}} \]
      3. pow218.3%

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{-1 + \left(-x\right)}{B}\right)}^{2}}} \]
      4. +-commutative18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\left(-x\right) + -1}}{B}\right)}^{2}} \]
      5. add-sqr-sqrt8.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}} + -1}{B}\right)}^{2}} \]
      6. sqrt-unprod18.4%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}} + -1}{B}\right)}^{2}} \]
      7. sqr-neg18.4%

        \[\leadsto \sqrt{{\left(\frac{\sqrt{\color{blue}{x \cdot x}} + -1}{B}\right)}^{2}} \]
      8. sqrt-unprod9.9%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}} + -1}{B}\right)}^{2}} \]
      9. add-sqr-sqrt18.3%

        \[\leadsto \sqrt{{\left(\frac{\color{blue}{x} + -1}{B}\right)}^{2}} \]
    7. Applied egg-rr18.3%

      \[\leadsto \color{blue}{\sqrt{{\left(\frac{x + -1}{B}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. unpow218.3%

        \[\leadsto \sqrt{\color{blue}{\frac{x + -1}{B} \cdot \frac{x + -1}{B}}} \]
      2. rem-sqrt-square39.7%

        \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
    9. Simplified39.7%

      \[\leadsto \color{blue}{\left|\frac{x + -1}{B}\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 7400000000:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{-1 + x}{B}\right|\\ \end{array} \]

Alternative 29: 36.4% accurate, 3.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.2e-47) (/ -1.0 (sin B)) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.2e-47) {
		tmp = -1.0 / sin(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 <= (-5.2d-47)) then
        tmp = (-1.0d0) / sin(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 <= -5.2e-47) {
		tmp = -1.0 / Math.sin(B);
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.2e-47:
		tmp = -1.0 / math.sin(B)
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.2e-47)
		tmp = Float64(-1.0 / sin(B));
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.2e-47)
		tmp = -1.0 / sin(B);
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.2e-47], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -5.2e-47

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 85.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 56.7%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)}\right) + \frac{-1}{\sin B} \]
    4. Step-by-step derivation
      1. *-commutative56.7%

        \[\leadsto \left(-\left(\frac{x}{B} + -0.3333333333333333 \cdot \color{blue}{\left(x \cdot B\right)}\right)\right) + \frac{-1}{\sin B} \]
    5. Simplified56.7%

      \[\leadsto \left(-\color{blue}{\left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)}\right) + \frac{-1}{\sin B} \]
    6. Taylor expanded in x around 0 53.1%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -5.2e-47 < F

    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 37.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 21.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/21.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in21.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval21.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-121.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified21.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 32.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/32.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg32.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified32.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 30: 36.9% accurate, 29.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-47}:\\ \;\;\;\;B \cdot -0.16666666666666666 + \frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5e-47)
   (+ (* B -0.16666666666666666) (/ (- -1.0 x) B))
   (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5e-47) {
		tmp = (B * -0.16666666666666666) + ((-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 <= (-5d-47)) then
        tmp = (b * (-0.16666666666666666d0)) + (((-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 <= -5e-47) {
		tmp = (B * -0.16666666666666666) + ((-1.0 - x) / B);
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5e-47:
		tmp = (B * -0.16666666666666666) + ((-1.0 - x) / B)
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5e-47)
		tmp = Float64(Float64(B * -0.16666666666666666) + 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 <= -5e-47)
		tmp = (B * -0.16666666666666666) + ((-1.0 - x) / B);
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5e-47], N[(N[(B * -0.16666666666666666), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-47}:\\
\;\;\;\;B \cdot -0.16666666666666666 + \frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -5.00000000000000011e-47

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 85.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 69.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    4. Taylor expanded in B around 0 43.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + -0.16666666666666666 \cdot B} \]
    5. Step-by-step derivation
      1. +-commutative43.7%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot B + -1 \cdot \frac{1 + x}{B}} \]
      2. mul-1-neg43.7%

        \[\leadsto -0.16666666666666666 \cdot B + \color{blue}{\left(-\frac{1 + x}{B}\right)} \]
      3. unsub-neg43.7%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot B - \frac{1 + x}{B}} \]
      4. *-commutative43.7%

        \[\leadsto \color{blue}{B \cdot -0.16666666666666666} - \frac{1 + x}{B} \]
      5. +-commutative43.7%

        \[\leadsto B \cdot -0.16666666666666666 - \frac{\color{blue}{x + 1}}{B} \]
    6. Simplified43.7%

      \[\leadsto \color{blue}{B \cdot -0.16666666666666666 - \frac{x + 1}{B}} \]

    if -5.00000000000000011e-47 < F

    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 37.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 21.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/21.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in21.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval21.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-121.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified21.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 32.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/32.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg32.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified32.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-47}:\\ \;\;\;\;B \cdot -0.16666666666666666 + \frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 31: 36.8% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.1e-47) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.1e-47) {
		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 <= (-4.1d-47)) 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 <= -4.1e-47) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.1e-47:
		tmp = (-1.0 - x) / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.1e-47)
		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 <= -4.1e-47)
		tmp = (-1.0 - x) / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.1e-47], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.1 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -4.10000000000000002e-47

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 85.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 43.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/43.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in43.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval43.7%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-143.7%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified43.7%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]

    if -4.10000000000000002e-47 < F

    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 37.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 21.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/21.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in21.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval21.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-121.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified21.8%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 32.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/32.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg32.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified32.9%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 32: 30.0% accurate, 53.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.85 \cdot 10^{+109}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.85e+109) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.85e+109) {
		tmp = -1.0 / 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.85d+109)) then
        tmp = (-1.0d0) / 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.85e+109) {
		tmp = -1.0 / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.85e+109:
		tmp = -1.0 / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.85e+109)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.85e+109)
		tmp = -1.0 / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.85e+109], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.85 \cdot 10^{+109}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -1.8500000000000001e109

    1. Initial program 38.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 54.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/54.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in54.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval54.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-154.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified54.6%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around 0 37.0%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if -1.8500000000000001e109 < F

    1. Initial program 80.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 41.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 23.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/23.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in23.0%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval23.0%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-123.0%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified23.0%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 30.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/30.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg30.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified30.4%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.85 \cdot 10^{+109}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 33: 10.1% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 73.1%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Taylor expanded in F around -inf 52.3%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  3. Taylor expanded in B around 0 28.7%

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  4. Step-by-step derivation
    1. associate-*r/28.7%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in28.7%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval28.7%

      \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
    4. neg-mul-128.7%

      \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
  5. Simplified28.7%

    \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
  6. Taylor expanded in x around 0 11.0%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification11.0%

    \[\leadsto \frac{-1}{B} \]

Reproduce

?
herbie shell --seed 2023250 
(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))))))