VandenBroeck and Keller, Equation (23)

Percentage Accurate: 64.8% → 89.5%
Time: 23.6s
Alternatives: 19
Speedup: 2.8×

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 19 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: 64.8% accurate, 1.0× speedup?

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

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

Alternative 1: 89.5% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ \begin{array}{l} t_0 := \frac{F}{\sin B\_m}\\ t_1 := \frac{x}{\tan B\_m}\\ t_2 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\ t_4 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot t\_2\\ B\_s \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq -1 \cdot 10^{-184}:\\ \;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B\_m} - t\_1\\ \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-170}:\\ \;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+219}:\\ \;\;\;\;t\_3 + t\_2 \cdot \left(F \cdot \frac{1}{\sin B\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B\_m} - t\_1\\ \end{array} \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (let* ((t_0 (/ F (sin B_m)))
        (t_1 (/ x (tan B_m)))
        (t_2 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
        (t_3 (/ -1.0 (/ (tan B_m) x)))
        (t_4 (+ (* x (/ -1.0 (tan B_m))) (* t_0 t_2))))
   (*
    B_s
    (if (<= t_4 -1e-184)
      (- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B_m))) t_1)
      (if (<= t_4 5e-170)
        (+ t_3 (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
        (if (<= t_4 5e+219)
          (+ t_3 (* t_2 (* F (/ 1.0 (sin B_m)))))
          (- (/ 1.0 B_m) t_1)))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double t_0 = F / sin(B_m);
	double t_1 = x / tan(B_m);
	double t_2 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double t_3 = -1.0 / (tan(B_m) / x);
	double t_4 = (x * (-1.0 / tan(B_m))) + (t_0 * t_2);
	double tmp;
	if (t_4 <= -1e-184) {
		tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B_m))) - t_1;
	} else if (t_4 <= 5e-170) {
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	} else if (t_4 <= 5e+219) {
		tmp = t_3 + (t_2 * (F * (1.0 / sin(B_m))));
	} else {
		tmp = (1.0 / B_m) - t_1;
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	t_0 = Float64(F / sin(B_m))
	t_1 = Float64(x / tan(B_m))
	t_2 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5
	t_3 = Float64(-1.0 / Float64(tan(B_m) / x))
	t_4 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(t_0 * t_2))
	tmp = 0.0
	if (t_4 <= -1e-184)
		tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B_m))) - t_1);
	elseif (t_4 <= 5e-170)
		tmp = Float64(t_3 + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F))));
	elseif (t_4 <= 5e+219)
		tmp = Float64(t_3 + Float64(t_2 * Float64(F * Float64(1.0 / sin(B_m)))));
	else
		tmp = Float64(Float64(1.0 / B_m) - t_1);
	end
	return Float64(B_s * tmp)
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$4, -1e-184], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 5e-170], N[(t$95$3 + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5e+219], N[(t$95$3 + N[(t$95$2 * N[(F * N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - t$95$1), $MachinePrecision]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := \frac{x}{\tan B\_m}\\
t_2 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\
t_4 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot t\_2\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B\_m} - t\_1\\

\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\

\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_3 + t\_2 \cdot \left(F \cdot \frac{1}{\sin B\_m}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B\_m} - t\_1\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184

    1. Initial program 81.6%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/87.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}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*87.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}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define87.6%

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

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

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

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

    if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170

    1. Initial program 44.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv44.8%

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

        \[\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)} \]
    4. Applied egg-rr44.5%

      \[\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)} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219

    1. Initial program 96.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv96.4%

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

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

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

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

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

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

    if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))

    1. Initial program 21.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. distribute-lft-neg-in21.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified33.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. Add Preprocessing
    5. Taylor expanded in F around inf 84.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq -1 \cdot 10^{-184}:\\ \;\;\;\;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{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 88.8% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ \begin{array}{l} t_0 := \frac{F}{\sin B\_m}\\ t_1 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ t_2 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot t\_1\\ t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\ B\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-184}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-170}:\\ \;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+219}:\\ \;\;\;\;t\_3 + t\_1 \cdot \left(F \cdot \frac{1}{\sin B\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\ \end{array} \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (let* ((t_0 (/ F (sin B_m)))
        (t_1 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
        (t_2 (+ (* x (/ -1.0 (tan B_m))) (* t_0 t_1)))
        (t_3 (/ -1.0 (/ (tan B_m) x))))
   (*
    B_s
    (if (<= t_2 -1e-184)
      t_2
      (if (<= t_2 5e-170)
        (+ t_3 (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
        (if (<= t_2 5e+219)
          (+ t_3 (* t_1 (* F (/ 1.0 (sin B_m)))))
          (- (/ 1.0 B_m) (/ x (tan B_m)))))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double t_0 = F / sin(B_m);
	double t_1 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double t_2 = (x * (-1.0 / tan(B_m))) + (t_0 * t_1);
	double t_3 = -1.0 / (tan(B_m) / x);
	double tmp;
	if (t_2 <= -1e-184) {
		tmp = t_2;
	} else if (t_2 <= 5e-170) {
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	} else if (t_2 <= 5e+219) {
		tmp = t_3 + (t_1 * (F * (1.0 / sin(B_m))));
	} else {
		tmp = (1.0 / B_m) - (x / tan(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = f / sin(b_m)
    t_1 = (((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)
    t_2 = (x * ((-1.0d0) / tan(b_m))) + (t_0 * t_1)
    t_3 = (-1.0d0) / (tan(b_m) / x)
    if (t_2 <= (-1d-184)) then
        tmp = t_2
    else if (t_2 <= 5d-170) then
        tmp = t_3 + (t_0 * (1.0d0 / ((((-1.0d0) - x) / f) - f)))
    else if (t_2 <= 5d+219) then
        tmp = t_3 + (t_1 * (f * (1.0d0 / sin(b_m))))
    else
        tmp = (1.0d0 / b_m) - (x / tan(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double t_0 = F / Math.sin(B_m);
	double t_1 = Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double t_2 = (x * (-1.0 / Math.tan(B_m))) + (t_0 * t_1);
	double t_3 = -1.0 / (Math.tan(B_m) / x);
	double tmp;
	if (t_2 <= -1e-184) {
		tmp = t_2;
	} else if (t_2 <= 5e-170) {
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	} else if (t_2 <= 5e+219) {
		tmp = t_3 + (t_1 * (F * (1.0 / Math.sin(B_m))));
	} else {
		tmp = (1.0 / B_m) - (x / Math.tan(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	t_0 = F / math.sin(B_m)
	t_1 = math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)
	t_2 = (x * (-1.0 / math.tan(B_m))) + (t_0 * t_1)
	t_3 = -1.0 / (math.tan(B_m) / x)
	tmp = 0
	if t_2 <= -1e-184:
		tmp = t_2
	elif t_2 <= 5e-170:
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)))
	elif t_2 <= 5e+219:
		tmp = t_3 + (t_1 * (F * (1.0 / math.sin(B_m))))
	else:
		tmp = (1.0 / B_m) - (x / math.tan(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	t_0 = Float64(F / sin(B_m))
	t_1 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5
	t_2 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(t_0 * t_1))
	t_3 = Float64(-1.0 / Float64(tan(B_m) / x))
	tmp = 0.0
	if (t_2 <= -1e-184)
		tmp = t_2;
	elseif (t_2 <= 5e-170)
		tmp = Float64(t_3 + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F))));
	elseif (t_2 <= 5e+219)
		tmp = Float64(t_3 + Float64(t_1 * Float64(F * Float64(1.0 / sin(B_m)))));
	else
		tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	t_0 = F / sin(B_m);
	t_1 = (((F * F) + 2.0) + (x * 2.0)) ^ -0.5;
	t_2 = (x * (-1.0 / tan(B_m))) + (t_0 * t_1);
	t_3 = -1.0 / (tan(B_m) / x);
	tmp = 0.0;
	if (t_2 <= -1e-184)
		tmp = t_2;
	elseif (t_2 <= 5e-170)
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	elseif (t_2 <= 5e+219)
		tmp = t_3 + (t_1 * (F * (1.0 / sin(B_m))));
	else
		tmp = (1.0 / B_m) - (x / tan(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$2, -1e-184], t$95$2, If[LessEqual[t$95$2, 5e-170], N[(t$95$3 + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+219], N[(t$95$3 + N[(t$95$1 * N[(F * N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_2 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot t\_1\\
t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_3 + t\_1 \cdot \left(F \cdot \frac{1}{\sin B\_m}\right)\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184

    1. Initial program 81.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. Add Preprocessing

    if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170

    1. Initial program 44.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv44.8%

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

        \[\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)} \]
    4. Applied egg-rr44.5%

      \[\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)} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219

    1. Initial program 96.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv96.4%

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

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

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

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

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

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

    if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))

    1. Initial program 21.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. distribute-lft-neg-in21.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified33.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. Add Preprocessing
    5. Taylor expanded in F around inf 84.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq -1 \cdot 10^{-184}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 88.8% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ \begin{array}{l} t_0 := \frac{F}{\sin B\_m}\\ t_1 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ B\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-184}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+219}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\ \end{array} \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (let* ((t_0 (/ F (sin B_m)))
        (t_1
         (+
          (* x (/ -1.0 (tan B_m)))
          (* t_0 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)))))
   (*
    B_s
    (if (<= t_1 -1e-184)
      t_1
      (if (<= t_1 5e-170)
        (+ (/ -1.0 (/ (tan B_m) x)) (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
        (if (<= t_1 5e+219) t_1 (- (/ 1.0 B_m) (/ x (tan B_m)))))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double t_0 = F / sin(B_m);
	double t_1 = (x * (-1.0 / tan(B_m))) + (t_0 * pow((((F * F) + 2.0) + (x * 2.0)), -0.5));
	double tmp;
	if (t_1 <= -1e-184) {
		tmp = t_1;
	} else if (t_1 <= 5e-170) {
		tmp = (-1.0 / (tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	} else if (t_1 <= 5e+219) {
		tmp = t_1;
	} else {
		tmp = (1.0 / B_m) - (x / tan(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = f / sin(b_m)
    t_1 = (x * ((-1.0d0) / tan(b_m))) + (t_0 * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)))
    if (t_1 <= (-1d-184)) then
        tmp = t_1
    else if (t_1 <= 5d-170) then
        tmp = ((-1.0d0) / (tan(b_m) / x)) + (t_0 * (1.0d0 / ((((-1.0d0) - x) / f) - f)))
    else if (t_1 <= 5d+219) then
        tmp = t_1
    else
        tmp = (1.0d0 / b_m) - (x / tan(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double t_0 = F / Math.sin(B_m);
	double t_1 = (x * (-1.0 / Math.tan(B_m))) + (t_0 * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5));
	double tmp;
	if (t_1 <= -1e-184) {
		tmp = t_1;
	} else if (t_1 <= 5e-170) {
		tmp = (-1.0 / (Math.tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	} else if (t_1 <= 5e+219) {
		tmp = t_1;
	} else {
		tmp = (1.0 / B_m) - (x / Math.tan(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	t_0 = F / math.sin(B_m)
	t_1 = (x * (-1.0 / math.tan(B_m))) + (t_0 * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5))
	tmp = 0
	if t_1 <= -1e-184:
		tmp = t_1
	elif t_1 <= 5e-170:
		tmp = (-1.0 / (math.tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F)))
	elif t_1 <= 5e+219:
		tmp = t_1
	else:
		tmp = (1.0 / B_m) - (x / math.tan(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	t_0 = Float64(F / sin(B_m))
	t_1 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(t_0 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)))
	tmp = 0.0
	if (t_1 <= -1e-184)
		tmp = t_1;
	elseif (t_1 <= 5e-170)
		tmp = Float64(Float64(-1.0 / Float64(tan(B_m) / x)) + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F))));
	elseif (t_1 <= 5e+219)
		tmp = t_1;
	else
		tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	t_0 = F / sin(B_m);
	t_1 = (x * (-1.0 / tan(B_m))) + (t_0 * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5));
	tmp = 0.0;
	if (t_1 <= -1e-184)
		tmp = t_1;
	elseif (t_1 <= 5e-170)
		tmp = (-1.0 / (tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	elseif (t_1 <= 5e+219)
		tmp = t_1;
	else
		tmp = (1.0 / B_m) - (x / tan(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$1, -1e-184], t$95$1, If[LessEqual[t$95$1, 5e-170], N[(N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+219], t$95$1, N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184 or 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219

    1. Initial program 87.6%

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

    if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170

    1. Initial program 44.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv44.8%

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

        \[\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)} \]
    4. Applied egg-rr44.5%

      \[\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)} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))

    1. Initial program 21.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. distribute-lft-neg-in21.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified33.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. Add Preprocessing
    5. Taylor expanded in F around inf 84.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq -1 \cdot 10^{-184}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 88.8% accurate, 0.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ \begin{array}{l} t_0 := \frac{F}{\sin B\_m}\\ t_1 := t\_0 \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ t_2 := x \cdot \frac{-1}{\tan B\_m} + t\_1\\ t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\ B\_s \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-184}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-170}:\\ \;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+219}:\\ \;\;\;\;t\_1 + t\_3\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\ \end{array} \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (let* ((t_0 (/ F (sin B_m)))
        (t_1 (* t_0 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)))
        (t_2 (+ (* x (/ -1.0 (tan B_m))) t_1))
        (t_3 (/ -1.0 (/ (tan B_m) x))))
   (*
    B_s
    (if (<= t_2 -1e-184)
      t_2
      (if (<= t_2 5e-170)
        (+ t_3 (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
        (if (<= t_2 5e+219) (+ t_1 t_3) (- (/ 1.0 B_m) (/ x (tan B_m)))))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double t_0 = F / sin(B_m);
	double t_1 = t_0 * pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double t_2 = (x * (-1.0 / tan(B_m))) + t_1;
	double t_3 = -1.0 / (tan(B_m) / x);
	double tmp;
	if (t_2 <= -1e-184) {
		tmp = t_2;
	} else if (t_2 <= 5e-170) {
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	} else if (t_2 <= 5e+219) {
		tmp = t_1 + t_3;
	} else {
		tmp = (1.0 / B_m) - (x / tan(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = f / sin(b_m)
    t_1 = t_0 * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))
    t_2 = (x * ((-1.0d0) / tan(b_m))) + t_1
    t_3 = (-1.0d0) / (tan(b_m) / x)
    if (t_2 <= (-1d-184)) then
        tmp = t_2
    else if (t_2 <= 5d-170) then
        tmp = t_3 + (t_0 * (1.0d0 / ((((-1.0d0) - x) / f) - f)))
    else if (t_2 <= 5d+219) then
        tmp = t_1 + t_3
    else
        tmp = (1.0d0 / b_m) - (x / tan(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double t_0 = F / Math.sin(B_m);
	double t_1 = t_0 * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
	double t_2 = (x * (-1.0 / Math.tan(B_m))) + t_1;
	double t_3 = -1.0 / (Math.tan(B_m) / x);
	double tmp;
	if (t_2 <= -1e-184) {
		tmp = t_2;
	} else if (t_2 <= 5e-170) {
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	} else if (t_2 <= 5e+219) {
		tmp = t_1 + t_3;
	} else {
		tmp = (1.0 / B_m) - (x / Math.tan(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	t_0 = F / math.sin(B_m)
	t_1 = t_0 * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)
	t_2 = (x * (-1.0 / math.tan(B_m))) + t_1
	t_3 = -1.0 / (math.tan(B_m) / x)
	tmp = 0
	if t_2 <= -1e-184:
		tmp = t_2
	elif t_2 <= 5e-170:
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)))
	elif t_2 <= 5e+219:
		tmp = t_1 + t_3
	else:
		tmp = (1.0 / B_m) - (x / math.tan(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	t_0 = Float64(F / sin(B_m))
	t_1 = Float64(t_0 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5))
	t_2 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + t_1)
	t_3 = Float64(-1.0 / Float64(tan(B_m) / x))
	tmp = 0.0
	if (t_2 <= -1e-184)
		tmp = t_2;
	elseif (t_2 <= 5e-170)
		tmp = Float64(t_3 + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F))));
	elseif (t_2 <= 5e+219)
		tmp = Float64(t_1 + t_3);
	else
		tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	t_0 = F / sin(B_m);
	t_1 = t_0 * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5);
	t_2 = (x * (-1.0 / tan(B_m))) + t_1;
	t_3 = -1.0 / (tan(B_m) / x);
	tmp = 0.0;
	if (t_2 <= -1e-184)
		tmp = t_2;
	elseif (t_2 <= 5e-170)
		tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
	elseif (t_2 <= 5e+219)
		tmp = t_1 + t_3;
	else
		tmp = (1.0 / B_m) - (x / tan(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$2, -1e-184], t$95$2, If[LessEqual[t$95$2, 5e-170], N[(t$95$3 + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+219], N[(t$95$1 + t$95$3), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := t\_0 \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_2 := x \cdot \frac{-1}{\tan B\_m} + t\_1\\
t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_1 + t\_3\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184

    1. Initial program 81.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. Add Preprocessing

    if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170

    1. Initial program 44.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv44.8%

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

        \[\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)} \]
    4. Applied egg-rr44.5%

      \[\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)} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt44.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219

    1. Initial program 96.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv96.4%

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

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

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

    if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2)))))

    1. Initial program 21.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. distribute-lft-neg-in21.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified33.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. Add Preprocessing
    5. Taylor expanded in F around inf 84.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq -1 \cdot 10^{-184}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{-170}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot \frac{1}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \leq 5 \cdot 10^{+219}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 87.8% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ \begin{array}{l} t_0 := \frac{1}{\sin B\_m}\\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-43}:\\ \;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + \frac{-1}{\sin B\_m}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-171}:\\ \;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - \frac{x}{\tan B\_m}\\ \mathbf{elif}\;F \leq 6.1 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B\_m} + t\_0\\ \end{array} \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (let* ((t_0 (/ 1.0 (sin B_m))))
   (*
    B_s
    (if (<= F -8.5e-43)
      (+ (/ -1.0 (/ (tan B_m) x)) (/ -1.0 (sin B_m)))
      (if (<= F -3.5e-171)
        (- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) (/ x (tan B_m)))
        (if (<= F 6.1e-44)
          (/ x (- (tan B_m)))
          (+ (* x (/ -1.0 (tan B_m))) t_0)))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double t_0 = 1.0 / sin(B_m);
	double tmp;
	if (F <= -8.5e-43) {
		tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m));
	} else if (F <= -3.5e-171) {
		tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / tan(B_m));
	} else if (F <= 6.1e-44) {
		tmp = x / -tan(B_m);
	} else {
		tmp = (x * (-1.0 / tan(B_m))) + t_0;
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 / sin(b_m)
    if (f <= (-8.5d-43)) then
        tmp = ((-1.0d0) / (tan(b_m) / x)) + ((-1.0d0) / sin(b_m))
    else if (f <= (-3.5d-171)) then
        tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - (x / tan(b_m))
    else if (f <= 6.1d-44) then
        tmp = x / -tan(b_m)
    else
        tmp = (x * ((-1.0d0) / tan(b_m))) + t_0
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double t_0 = 1.0 / Math.sin(B_m);
	double tmp;
	if (F <= -8.5e-43) {
		tmp = (-1.0 / (Math.tan(B_m) / x)) + (-1.0 / Math.sin(B_m));
	} else if (F <= -3.5e-171) {
		tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / Math.tan(B_m));
	} else if (F <= 6.1e-44) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = (x * (-1.0 / Math.tan(B_m))) + t_0;
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	t_0 = 1.0 / math.sin(B_m)
	tmp = 0
	if F <= -8.5e-43:
		tmp = (-1.0 / (math.tan(B_m) / x)) + (-1.0 / math.sin(B_m))
	elif F <= -3.5e-171:
		tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / math.tan(B_m))
	elif F <= 6.1e-44:
		tmp = x / -math.tan(B_m)
	else:
		tmp = (x * (-1.0 / math.tan(B_m))) + t_0
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	t_0 = Float64(1.0 / sin(B_m))
	tmp = 0.0
	if (F <= -8.5e-43)
		tmp = Float64(Float64(-1.0 / Float64(tan(B_m) / x)) + Float64(-1.0 / sin(B_m)));
	elseif (F <= -3.5e-171)
		tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - Float64(x / tan(B_m)));
	elseif (F <= 6.1e-44)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + t_0);
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	t_0 = 1.0 / sin(B_m);
	tmp = 0.0;
	if (F <= -8.5e-43)
		tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m));
	elseif (F <= -3.5e-171)
		tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / tan(B_m));
	elseif (F <= 6.1e-44)
		tmp = x / -tan(B_m);
	else
		tmp = (x * (-1.0 / tan(B_m))) + t_0;
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[F, -8.5e-43], N[(N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.5e-171], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.1e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

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

\mathbf{elif}\;F \leq -3.5 \cdot 10^{-171}:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - \frac{x}{\tan B\_m}\\

\mathbf{elif}\;F \leq 6.1 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B\_m} + t\_0\\


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

    1. Initial program 62.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv62.5%

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

        \[\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)} \]
    4. Applied egg-rr62.5%

      \[\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)} \]
    5. Step-by-step derivation
      1. clear-num62.4%

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

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

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

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

    if -8.50000000000000056e-43 < F < -3.49999999999999994e-171

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

    if -3.49999999999999994e-171 < F < 6.0999999999999996e-44

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    9. Applied egg-rr84.2%

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity84.2%

        \[\leadsto -\color{blue}{1 \cdot \frac{\cos B \cdot x}{\sin B}} \]
      2. clear-num84.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B \cdot x}}} \]
      3. /-rgt-identity84.0%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv84.0%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval84.0%

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

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B} \cdot \frac{1}{x}} \]
      8. div-inv84.0%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B}{x}}} \]
      9. clear-num84.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr84.3%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity84.3%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    13. Simplified84.3%

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

    if 6.0999999999999996e-44 < F

    1. Initial program 52.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-43}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{-171}:\\ \;\;\;\;F \cdot \left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.1 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 87.7% accurate, 1.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ \begin{array}{l} t_0 := \frac{-1}{\frac{\tan B\_m}{x}}\\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-43}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B\_m}\\ \mathbf{elif}\;F \leq -2.75 \cdot 10^{-171}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B\_m} \cdot \frac{1}{\sqrt{2 + x \cdot 2}}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-45}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B\_m} + \frac{1}{\sin B\_m}\\ \end{array} \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (let* ((t_0 (/ -1.0 (/ (tan B_m) x))))
   (*
    B_s
    (if (<= F -5.8e-43)
      (+ t_0 (/ -1.0 (sin B_m)))
      (if (<= F -2.75e-171)
        (+ t_0 (* (/ F (sin B_m)) (/ 1.0 (sqrt (+ 2.0 (* x 2.0))))))
        (if (<= F 8e-45)
          (/ x (- (tan B_m)))
          (+ (* x (/ -1.0 (tan B_m))) (/ 1.0 (sin B_m)))))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double t_0 = -1.0 / (tan(B_m) / x);
	double tmp;
	if (F <= -5.8e-43) {
		tmp = t_0 + (-1.0 / sin(B_m));
	} else if (F <= -2.75e-171) {
		tmp = t_0 + ((F / sin(B_m)) * (1.0 / sqrt((2.0 + (x * 2.0)))));
	} else if (F <= 8e-45) {
		tmp = x / -tan(B_m);
	} else {
		tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-1.0d0) / (tan(b_m) / x)
    if (f <= (-5.8d-43)) then
        tmp = t_0 + ((-1.0d0) / sin(b_m))
    else if (f <= (-2.75d-171)) then
        tmp = t_0 + ((f / sin(b_m)) * (1.0d0 / sqrt((2.0d0 + (x * 2.0d0)))))
    else if (f <= 8d-45) then
        tmp = x / -tan(b_m)
    else
        tmp = (x * ((-1.0d0) / tan(b_m))) + (1.0d0 / sin(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double t_0 = -1.0 / (Math.tan(B_m) / x);
	double tmp;
	if (F <= -5.8e-43) {
		tmp = t_0 + (-1.0 / Math.sin(B_m));
	} else if (F <= -2.75e-171) {
		tmp = t_0 + ((F / Math.sin(B_m)) * (1.0 / Math.sqrt((2.0 + (x * 2.0)))));
	} else if (F <= 8e-45) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = (x * (-1.0 / Math.tan(B_m))) + (1.0 / Math.sin(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	t_0 = -1.0 / (math.tan(B_m) / x)
	tmp = 0
	if F <= -5.8e-43:
		tmp = t_0 + (-1.0 / math.sin(B_m))
	elif F <= -2.75e-171:
		tmp = t_0 + ((F / math.sin(B_m)) * (1.0 / math.sqrt((2.0 + (x * 2.0)))))
	elif F <= 8e-45:
		tmp = x / -math.tan(B_m)
	else:
		tmp = (x * (-1.0 / math.tan(B_m))) + (1.0 / math.sin(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	t_0 = Float64(-1.0 / Float64(tan(B_m) / x))
	tmp = 0.0
	if (F <= -5.8e-43)
		tmp = Float64(t_0 + Float64(-1.0 / sin(B_m)));
	elseif (F <= -2.75e-171)
		tmp = Float64(t_0 + Float64(Float64(F / sin(B_m)) * Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0))))));
	elseif (F <= 8e-45)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(1.0 / sin(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	t_0 = -1.0 / (tan(B_m) / x);
	tmp = 0.0;
	if (F <= -5.8e-43)
		tmp = t_0 + (-1.0 / sin(B_m));
	elseif (F <= -2.75e-171)
		tmp = t_0 + ((F / sin(B_m)) * (1.0 / sqrt((2.0 + (x * 2.0)))));
	elseif (F <= 8e-45)
		tmp = x / -tan(B_m);
	else
		tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[F, -5.8e-43], N[(t$95$0 + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.75e-171], N[(t$95$0 + N[(N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-45], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
\begin{array}{l}
t_0 := \frac{-1}{\frac{\tan B\_m}{x}}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -5.8 \cdot 10^{-43}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B\_m}\\

\mathbf{elif}\;F \leq -2.75 \cdot 10^{-171}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B\_m} \cdot \frac{1}{\sqrt{2 + x \cdot 2}}\\

\mathbf{elif}\;F \leq 8 \cdot 10^{-45}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\

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


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

    1. Initial program 62.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv62.5%

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

        \[\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)} \]
    4. Applied egg-rr62.5%

      \[\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)} \]
    5. Step-by-step derivation
      1. clear-num62.4%

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

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

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

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

    if -5.8000000000000003e-43 < F < -2.75000000000000018e-171

    1. Initial program 82.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv82.1%

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

        \[\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)} \]
    4. Applied egg-rr82.1%

      \[\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)} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt82.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.75000000000000018e-171 < F < 7.99999999999999987e-45

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    9. Applied egg-rr84.2%

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity84.2%

        \[\leadsto -\color{blue}{1 \cdot \frac{\cos B \cdot x}{\sin B}} \]
      2. clear-num84.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B \cdot x}}} \]
      3. /-rgt-identity84.0%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv84.0%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval84.0%

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

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B} \cdot \frac{1}{x}} \]
      8. div-inv84.0%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B}{x}}} \]
      9. clear-num84.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr84.3%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity84.3%

        \[\leadsto -\color{blue}{\frac{x}{\tan B}} \]
    13. Simplified84.3%

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

    if 7.99999999999999987e-45 < F

    1. Initial program 52.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-43}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -2.75 \cdot 10^{-171}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-45}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.2% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B\_m}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B\_m} - \frac{x}{\tan B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -2.4e+56)
    (/ (- -1.0 x) B_m)
    (if (<= F 4.3e-44)
      (/ x (- (tan B_m)))
      (- (/ F (* F (sin B_m))) (/ x (tan B_m)))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.4e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 4.3e-44) {
		tmp = x / -tan(B_m);
	} else {
		tmp = (F / (F * sin(B_m))) - (x / tan(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.4d+56)) then
        tmp = ((-1.0d0) - x) / b_m
    else if (f <= 4.3d-44) then
        tmp = x / -tan(b_m)
    else
        tmp = (f / (f * sin(b_m))) - (x / tan(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.4e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 4.3e-44) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = (F / (F * Math.sin(B_m))) - (x / Math.tan(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -2.4e+56:
		tmp = (-1.0 - x) / B_m
	elif F <= 4.3e-44:
		tmp = x / -math.tan(B_m)
	else:
		tmp = (F / (F * math.sin(B_m))) - (x / math.tan(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -2.4e+56)
		tmp = Float64(Float64(-1.0 - x) / B_m);
	elseif (F <= 4.3e-44)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(Float64(F / Float64(F * sin(B_m))) - Float64(x / tan(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -2.4e+56)
		tmp = (-1.0 - x) / B_m;
	elseif (F <= 4.3e-44)
		tmp = x / -tan(B_m);
	else
		tmp = (F / (F * sin(B_m))) - (x / tan(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.4e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 4.3e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\

\mathbf{elif}\;F \leq 4.3 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\

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


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

    1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000013e56 < F < 4.30000000000000013e-44

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. *-commutative77.0%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
    7. Simplified77.0%

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

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

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity77.1%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B \cdot x}}} \]
      3. /-rgt-identity76.9%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv76.9%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval76.9%

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

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr77.2%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity77.2%

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

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

    if 4.30000000000000013e-44 < F

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 86.6% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-85}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B\_m} + \frac{-1}{\sin B\_m}\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B\_m} - \frac{x}{\tan B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -1.25e-85)
    (+ (* x (/ -1.0 (tan B_m))) (/ -1.0 (sin B_m)))
    (if (<= F 5.6e-44)
      (/ x (- (tan B_m)))
      (- (/ F (* F (sin B_m))) (/ x (tan B_m)))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -1.25e-85) {
		tmp = (x * (-1.0 / tan(B_m))) + (-1.0 / sin(B_m));
	} else if (F <= 5.6e-44) {
		tmp = x / -tan(B_m);
	} else {
		tmp = (F / (F * sin(B_m))) - (x / tan(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.25d-85)) then
        tmp = (x * ((-1.0d0) / tan(b_m))) + ((-1.0d0) / sin(b_m))
    else if (f <= 5.6d-44) then
        tmp = x / -tan(b_m)
    else
        tmp = (f / (f * sin(b_m))) - (x / tan(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -1.25e-85) {
		tmp = (x * (-1.0 / Math.tan(B_m))) + (-1.0 / Math.sin(B_m));
	} else if (F <= 5.6e-44) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = (F / (F * Math.sin(B_m))) - (x / Math.tan(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -1.25e-85:
		tmp = (x * (-1.0 / math.tan(B_m))) + (-1.0 / math.sin(B_m))
	elif F <= 5.6e-44:
		tmp = x / -math.tan(B_m)
	else:
		tmp = (F / (F * math.sin(B_m))) - (x / math.tan(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -1.25e-85)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(-1.0 / sin(B_m)));
	elseif (F <= 5.6e-44)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(Float64(F / Float64(F * sin(B_m))) - Float64(x / tan(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -1.25e-85)
		tmp = (x * (-1.0 / tan(B_m))) + (-1.0 / sin(B_m));
	elseif (F <= 5.6e-44)
		tmp = x / -tan(B_m);
	else
		tmp = (F / (F * sin(B_m))) - (x / tan(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -1.25e-85], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

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

\mathbf{elif}\;F \leq 5.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\

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


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

    1. Initial program 64.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. Add Preprocessing
    3. Taylor expanded in F around -inf 91.3%

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

    if -1.25e-85 < F < 5.6e-44

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity81.1%

        \[\leadsto -\color{blue}{1 \cdot \frac{\cos B \cdot x}{\sin B}} \]
      2. clear-num80.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B \cdot x}}} \]
      3. /-rgt-identity80.9%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv80.9%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval80.9%

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

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B} \cdot \frac{1}{x}} \]
      8. div-inv81.0%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr81.2%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity81.2%

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

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

    if 5.6e-44 < F

    1. Initial program 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-85}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 5.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 86.7% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B\_m}\\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-85}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B\_m}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B\_m}\\ \end{array} \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (let* ((t_0 (* x (/ -1.0 (tan B_m)))))
   (*
    B_s
    (if (<= F -1.5e-85)
      (+ t_0 (/ -1.0 (sin B_m)))
      (if (<= F 2.4e-44) (/ x (- (tan B_m))) (+ t_0 (/ 1.0 (sin B_m))))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double t_0 = x * (-1.0 / tan(B_m));
	double tmp;
	if (F <= -1.5e-85) {
		tmp = t_0 + (-1.0 / sin(B_m));
	} else if (F <= 2.4e-44) {
		tmp = x / -tan(B_m);
	} else {
		tmp = t_0 + (1.0 / sin(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x * ((-1.0d0) / tan(b_m))
    if (f <= (-1.5d-85)) then
        tmp = t_0 + ((-1.0d0) / sin(b_m))
    else if (f <= 2.4d-44) then
        tmp = x / -tan(b_m)
    else
        tmp = t_0 + (1.0d0 / sin(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double t_0 = x * (-1.0 / Math.tan(B_m));
	double tmp;
	if (F <= -1.5e-85) {
		tmp = t_0 + (-1.0 / Math.sin(B_m));
	} else if (F <= 2.4e-44) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = t_0 + (1.0 / Math.sin(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	t_0 = x * (-1.0 / math.tan(B_m))
	tmp = 0
	if F <= -1.5e-85:
		tmp = t_0 + (-1.0 / math.sin(B_m))
	elif F <= 2.4e-44:
		tmp = x / -math.tan(B_m)
	else:
		tmp = t_0 + (1.0 / math.sin(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	t_0 = Float64(x * Float64(-1.0 / tan(B_m)))
	tmp = 0.0
	if (F <= -1.5e-85)
		tmp = Float64(t_0 + Float64(-1.0 / sin(B_m)));
	elseif (F <= 2.4e-44)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(t_0 + Float64(1.0 / sin(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	t_0 = x * (-1.0 / tan(B_m));
	tmp = 0.0;
	if (F <= -1.5e-85)
		tmp = t_0 + (-1.0 / sin(B_m));
	elseif (F <= 2.4e-44)
		tmp = x / -tan(B_m);
	else
		tmp = t_0 + (1.0 / sin(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[F, -1.5e-85], N[(t$95$0 + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B\_m}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-85}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B\_m}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\

\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B\_m}\\


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

    1. Initial program 64.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. Add Preprocessing
    3. Taylor expanded in F around -inf 91.3%

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

    if -1.50000000000000011e-85 < F < 2.40000000000000009e-44

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity81.1%

        \[\leadsto -\color{blue}{1 \cdot \frac{\cos B \cdot x}{\sin B}} \]
      2. clear-num80.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B \cdot x}}} \]
      3. /-rgt-identity80.9%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv80.9%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval80.9%

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

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B} \cdot \frac{1}{x}} \]
      8. div-inv81.0%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr81.2%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity81.2%

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

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

    if 2.40000000000000009e-44 < F

    1. Initial program 52.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-85}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 86.9% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + \frac{-1}{\sin B\_m}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B\_m} + \frac{1}{\sin B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -1.8e-67)
    (+ (/ -1.0 (/ (tan B_m) x)) (/ -1.0 (sin B_m)))
    (if (<= F 1.6e-44)
      (/ x (- (tan B_m)))
      (+ (* x (/ -1.0 (tan B_m))) (/ 1.0 (sin B_m)))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -1.8e-67) {
		tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m));
	} else if (F <= 1.6e-44) {
		tmp = x / -tan(B_m);
	} else {
		tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.8d-67)) then
        tmp = ((-1.0d0) / (tan(b_m) / x)) + ((-1.0d0) / sin(b_m))
    else if (f <= 1.6d-44) then
        tmp = x / -tan(b_m)
    else
        tmp = (x * ((-1.0d0) / tan(b_m))) + (1.0d0 / sin(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -1.8e-67) {
		tmp = (-1.0 / (Math.tan(B_m) / x)) + (-1.0 / Math.sin(B_m));
	} else if (F <= 1.6e-44) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = (x * (-1.0 / Math.tan(B_m))) + (1.0 / Math.sin(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -1.8e-67:
		tmp = (-1.0 / (math.tan(B_m) / x)) + (-1.0 / math.sin(B_m))
	elif F <= 1.6e-44:
		tmp = x / -math.tan(B_m)
	else:
		tmp = (x * (-1.0 / math.tan(B_m))) + (1.0 / math.sin(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -1.8e-67)
		tmp = Float64(Float64(-1.0 / Float64(tan(B_m) / x)) + Float64(-1.0 / sin(B_m)));
	elseif (F <= 1.6e-44)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(1.0 / sin(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -1.8e-67)
		tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m));
	elseif (F <= 1.6e-44)
		tmp = x / -tan(B_m);
	else
		tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -1.8e-67], N[(N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-67}:\\
\;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + \frac{-1}{\sin B\_m}\\

\mathbf{elif}\;F \leq 1.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\

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


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

    1. Initial program 64.9%

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

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

        \[\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)} \]
    4. Applied egg-rr64.9%

      \[\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)} \]
    5. Step-by-step derivation
      1. clear-num64.8%

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

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

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

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

    if -1.8e-67 < F < 1.59999999999999997e-44

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. *-commutative80.5%

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

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    9. Applied egg-rr80.5%

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity80.5%

        \[\leadsto -\color{blue}{1 \cdot \frac{\cos B \cdot x}{\sin B}} \]
      2. clear-num80.4%

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

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv80.4%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval80.4%

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

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

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B}{x}}} \]
      9. clear-num80.7%

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr80.7%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity80.7%

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

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

    if 1.59999999999999997e-44 < F

    1. Initial program 52.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-44}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 68.9% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B\_m}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-31}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -2.5e+56)
    (/ (- -1.0 x) B_m)
    (if (<= F 1.6e-31) (/ x (- (tan B_m))) (- (/ 1.0 B_m) (/ x (tan B_m)))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.5e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.6e-31) {
		tmp = x / -tan(B_m);
	} else {
		tmp = (1.0 / B_m) - (x / tan(B_m));
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.5d+56)) then
        tmp = ((-1.0d0) - x) / b_m
    else if (f <= 1.6d-31) then
        tmp = x / -tan(b_m)
    else
        tmp = (1.0d0 / b_m) - (x / tan(b_m))
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.5e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.6e-31) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = (1.0 / B_m) - (x / Math.tan(B_m));
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -2.5e+56:
		tmp = (-1.0 - x) / B_m
	elif F <= 1.6e-31:
		tmp = x / -math.tan(B_m)
	else:
		tmp = (1.0 / B_m) - (x / math.tan(B_m))
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -2.5e+56)
		tmp = Float64(Float64(-1.0 - x) / B_m);
	elseif (F <= 1.6e-31)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m)));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -2.5e+56)
		tmp = (-1.0 - x) / B_m;
	elseif (F <= 1.6e-31)
		tmp = x / -tan(B_m);
	else
		tmp = (1.0 / B_m) - (x / tan(B_m));
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.5e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.6e-31], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\

\mathbf{elif}\;F \leq 1.6 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\

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


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

    1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000012e56 < F < 1.60000000000000009e-31

    1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity75.1%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B \cdot x}}} \]
      3. /-rgt-identity75.0%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv75.0%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval75.0%

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

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B} \cdot \frac{1}{x}} \]
      8. div-inv75.0%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B}{x}}} \]
      9. clear-num75.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr75.3%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity75.3%

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

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

    if 1.60000000000000009e-31 < F

    1. Initial program 49.2%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/60.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}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*60.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}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define60.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.5 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-31}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 45.8% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B\_m}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{-\sin B\_m}\\ \mathbf{else}:\\ \;\;\;\;B\_m \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -2.4e+56)
    (/ (- -1.0 x) B_m)
    (if (<= F 1.3e-6)
      (/ x (- (sin B_m)))
      (+
       (* B_m (+ 0.16666666666666666 (* x 0.3333333333333333)))
       (/ (- 1.0 x) B_m))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.4e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.3e-6) {
		tmp = x / -sin(B_m);
	} else {
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.4d+56)) then
        tmp = ((-1.0d0) - x) / b_m
    else if (f <= 1.3d-6) then
        tmp = x / -sin(b_m)
    else
        tmp = (b_m * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b_m)
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.4e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.3e-6) {
		tmp = x / -Math.sin(B_m);
	} else {
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -2.4e+56:
		tmp = (-1.0 - x) / B_m
	elif F <= 1.3e-6:
		tmp = x / -math.sin(B_m)
	else:
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m)
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -2.4e+56)
		tmp = Float64(Float64(-1.0 - x) / B_m);
	elseif (F <= 1.3e-6)
		tmp = Float64(x / Float64(-sin(B_m)));
	else
		tmp = Float64(Float64(B_m * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B_m));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -2.4e+56)
		tmp = (-1.0 - x) / B_m;
	elseif (F <= 1.3e-6)
		tmp = x / -sin(B_m);
	else
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.4e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.3e-6], N[(x / (-N[Sin[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(B$95$m * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\

\mathbf{elif}\;F \leq 1.3 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{-\sin B\_m}\\

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


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

    1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000013e56 < F < 1.30000000000000005e-6

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. *-commutative75.8%

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

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

        \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    9. Applied egg-rr75.8%

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

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

    if 1.30000000000000005e-6 < F

    1. Initial program 50.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv50.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-num50.7%

        \[\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)} \]
    4. Applied egg-rr50.7%

      \[\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)} \]
    5. Taylor expanded in F around inf 79.8%

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

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

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

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 - -0.3333333333333333 \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. cancel-sign-sub-inv59.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 63.1% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B\_m}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{+94}:\\ \;\;\;\;\frac{x}{-\tan B\_m}\\ \mathbf{else}:\\ \;\;\;\;B\_m \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -2.6e+56)
    (/ (- -1.0 x) B_m)
    (if (<= F 6.5e+94)
      (/ x (- (tan B_m)))
      (+
       (* B_m (+ 0.16666666666666666 (* x 0.3333333333333333)))
       (/ (- 1.0 x) B_m))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.6e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 6.5e+94) {
		tmp = x / -tan(B_m);
	} else {
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.6d+56)) then
        tmp = ((-1.0d0) - x) / b_m
    else if (f <= 6.5d+94) then
        tmp = x / -tan(b_m)
    else
        tmp = (b_m * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b_m)
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.6e+56) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 6.5e+94) {
		tmp = x / -Math.tan(B_m);
	} else {
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -2.6e+56:
		tmp = (-1.0 - x) / B_m
	elif F <= 6.5e+94:
		tmp = x / -math.tan(B_m)
	else:
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m)
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -2.6e+56)
		tmp = Float64(Float64(-1.0 - x) / B_m);
	elseif (F <= 6.5e+94)
		tmp = Float64(x / Float64(-tan(B_m)));
	else
		tmp = Float64(Float64(B_m * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B_m));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -2.6e+56)
		tmp = (-1.0 - x) / B_m;
	elseif (F <= 6.5e+94)
		tmp = x / -tan(B_m);
	else
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.6e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 6.5e+94], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(B$95$m * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\

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

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


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

    1. Initial program 48.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.60000000000000011e56 < F < 6.49999999999999976e94

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. *-commutative73.6%

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

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

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

      \[\leadsto -\color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity73.6%

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

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

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\frac{\sin B}{1}}}{\cos B \cdot x}} \]
      4. div-inv73.4%

        \[\leadsto -1 \cdot \frac{1}{\frac{\color{blue}{\sin B \cdot \frac{1}{1}}}{\cos B \cdot x}} \]
      5. metadata-eval73.4%

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

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

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\tan B} \cdot \frac{1}{x}} \]
      8. div-inv73.5%

        \[\leadsto -1 \cdot \frac{1}{\color{blue}{\frac{\tan B}{x}}} \]
      9. clear-num73.7%

        \[\leadsto -1 \cdot \color{blue}{\frac{x}{\tan B}} \]
    11. Applied egg-rr73.7%

      \[\leadsto -\color{blue}{1 \cdot \frac{x}{\tan B}} \]
    12. Step-by-step derivation
      1. *-lft-identity73.7%

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

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

    if 6.49999999999999976e94 < F

    1. Initial program 42.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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv42.4%

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

        \[\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)} \]
    4. Applied egg-rr42.5%

      \[\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)} \]
    5. Taylor expanded in F around inf 74.5%

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

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

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

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 - -0.3333333333333333 \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. cancel-sign-sub-inv65.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{+56}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{+94}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 44.9% accurate, 14.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-106}:\\ \;\;\;\;\frac{-1 - x}{B\_m}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-15}:\\ \;\;\;\;-\frac{x}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;B\_m \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -8.5e-106)
    (/ (- -1.0 x) B_m)
    (if (<= F 1.45e-15)
      (- (/ x B_m))
      (+
       (* B_m (+ 0.16666666666666666 (* x 0.3333333333333333)))
       (/ (- 1.0 x) B_m))))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -8.5e-106) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.45e-15) {
		tmp = -(x / B_m);
	} else {
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-8.5d-106)) then
        tmp = ((-1.0d0) - x) / b_m
    else if (f <= 1.45d-15) then
        tmp = -(x / b_m)
    else
        tmp = (b_m * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b_m)
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -8.5e-106) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.45e-15) {
		tmp = -(x / B_m);
	} else {
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -8.5e-106:
		tmp = (-1.0 - x) / B_m
	elif F <= 1.45e-15:
		tmp = -(x / B_m)
	else:
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m)
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -8.5e-106)
		tmp = Float64(Float64(-1.0 - x) / B_m);
	elseif (F <= 1.45e-15)
		tmp = Float64(-Float64(x / B_m));
	else
		tmp = Float64(Float64(B_m * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B_m));
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -8.5e-106)
		tmp = (-1.0 - x) / B_m;
	elseif (F <= 1.45e-15)
		tmp = -(x / B_m);
	else
		tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -8.5e-106], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.45e-15], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(B$95$m * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

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

\mathbf{elif}\;F \leq 1.45 \cdot 10^{-15}:\\
\;\;\;\;-\frac{x}{B\_m}\\

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


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

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999998e-106 < F < 1.45000000000000009e-15

    1. Initial program 68.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. distribute-lft-neg-in68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg37.2%

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

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

    if 1.45000000000000009e-15 < F

    1. Initial program 50.0%

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

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

        \[\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)} \]
    4. Applied egg-rr49.9%

      \[\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)} \]
    5. Taylor expanded in F around inf 80.1%

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

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

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

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 - -0.3333333333333333 \cdot x\right) + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. cancel-sign-sub-inv58.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{-106}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-15}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 34.4% accurate, 21.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{-134} \lor \neg \left(x \leq 7.4 \cdot 10^{-211}\right):\\ \;\;\;\;-\frac{x}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (or (<= x -7.5e-134) (not (<= x 7.4e-211)))
    (- (/ x B_m))
    (/ (+ x 1.0) B_m))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if ((x <= -7.5e-134) || !(x <= 7.4e-211)) {
		tmp = -(x / B_m);
	} else {
		tmp = (x + 1.0) / B_m;
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-7.5d-134)) .or. (.not. (x <= 7.4d-211))) then
        tmp = -(x / b_m)
    else
        tmp = (x + 1.0d0) / b_m
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if ((x <= -7.5e-134) || !(x <= 7.4e-211)) {
		tmp = -(x / B_m);
	} else {
		tmp = (x + 1.0) / B_m;
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if (x <= -7.5e-134) or not (x <= 7.4e-211):
		tmp = -(x / B_m)
	else:
		tmp = (x + 1.0) / B_m
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if ((x <= -7.5e-134) || !(x <= 7.4e-211))
		tmp = Float64(-Float64(x / B_m));
	else
		tmp = Float64(Float64(x + 1.0) / B_m);
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if ((x <= -7.5e-134) || ~((x <= 7.4e-211)))
		tmp = -(x / B_m);
	else
		tmp = (x + 1.0) / B_m;
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[Or[LessEqual[x, -7.5e-134], N[Not[LessEqual[x, 7.4e-211]], $MachinePrecision]], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(x + 1.0), $MachinePrecision] / B$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-134} \lor \neg \left(x \leq 7.4 \cdot 10^{-211}\right):\\
\;\;\;\;-\frac{x}{B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.50000000000000048e-134 or 7.3999999999999996e-211 < x

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg39.4%

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

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

    if -7.50000000000000048e-134 < x < 7.3999999999999996e-211

    1. Initial program 61.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. distribute-lft-neg-in61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{1 - x}}{B} \]
    8. Simplified27.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity27.3%

        \[\leadsto \color{blue}{1 \cdot \frac{1 - x}{B}} \]
      2. sub-neg27.3%

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

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

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

        \[\leadsto 1 \cdot \frac{1 + \sqrt{\color{blue}{x \cdot x}}}{B} \]
      6. sqrt-unprod6.5%

        \[\leadsto 1 \cdot \frac{1 + \color{blue}{\sqrt{x} \cdot \sqrt{x}}}{B} \]
      7. add-sqr-sqrt27.3%

        \[\leadsto 1 \cdot \frac{1 + \color{blue}{x}}{B} \]
    10. Applied egg-rr27.3%

      \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{B}} \]
    11. Step-by-step derivation
      1. *-lft-identity27.3%

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

        \[\leadsto \frac{\color{blue}{x + 1}}{B} \]
    12. Simplified27.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{-134} \lor \neg \left(x \leq 7.4 \cdot 10^{-211}\right):\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 44.9% accurate, 21.6× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-105}:\\ \;\;\;\;\frac{-1 - x}{B\_m}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-27}:\\ \;\;\;\;-\frac{x}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (<= F -2.2e-105)
    (/ (- -1.0 x) B_m)
    (if (<= F 1.05e-27) (- (/ x B_m)) (/ (- 1.0 x) B_m)))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.2e-105) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.05e-27) {
		tmp = -(x / B_m);
	} else {
		tmp = (1.0 - x) / B_m;
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-2.2d-105)) then
        tmp = ((-1.0d0) - x) / b_m
    else if (f <= 1.05d-27) then
        tmp = -(x / b_m)
    else
        tmp = (1.0d0 - x) / b_m
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= -2.2e-105) {
		tmp = (-1.0 - x) / B_m;
	} else if (F <= 1.05e-27) {
		tmp = -(x / B_m);
	} else {
		tmp = (1.0 - x) / B_m;
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= -2.2e-105:
		tmp = (-1.0 - x) / B_m
	elif F <= 1.05e-27:
		tmp = -(x / B_m)
	else:
		tmp = (1.0 - x) / B_m
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= -2.2e-105)
		tmp = Float64(Float64(-1.0 - x) / B_m);
	elseif (F <= 1.05e-27)
		tmp = Float64(-Float64(x / B_m));
	else
		tmp = Float64(Float64(1.0 - x) / B_m);
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= -2.2e-105)
		tmp = (-1.0 - x) / B_m;
	elseif (F <= 1.05e-27)
		tmp = -(x / B_m);
	else
		tmp = (1.0 - x) / B_m;
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.2e-105], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.05e-27], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.2 \cdot 10^{-105}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-27}:\\
\;\;\;\;-\frac{x}{B\_m}\\

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


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

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000004e-105 < F < 1.05000000000000008e-27

    1. Initial program 69.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. distribute-lft-neg-in69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg36.3%

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

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

    if 1.05000000000000008e-27 < F

    1. Initial program 49.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.2 \cdot 10^{-105}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-27}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 34.4% accurate, 23.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-135} \lor \neg \left(x \leq 4.7 \cdot 10^{-208}\right):\\ \;\;\;\;-\frac{x}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (*
  B_s
  (if (or (<= x -2.6e-135) (not (<= x 4.7e-208))) (- (/ x B_m)) (/ 1.0 B_m))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if ((x <= -2.6e-135) || !(x <= 4.7e-208)) {
		tmp = -(x / B_m);
	} else {
		tmp = 1.0 / B_m;
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-2.6d-135)) .or. (.not. (x <= 4.7d-208))) then
        tmp = -(x / b_m)
    else
        tmp = 1.0d0 / b_m
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if ((x <= -2.6e-135) || !(x <= 4.7e-208)) {
		tmp = -(x / B_m);
	} else {
		tmp = 1.0 / B_m;
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if (x <= -2.6e-135) or not (x <= 4.7e-208):
		tmp = -(x / B_m)
	else:
		tmp = 1.0 / B_m
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if ((x <= -2.6e-135) || !(x <= 4.7e-208))
		tmp = Float64(-Float64(x / B_m));
	else
		tmp = Float64(1.0 / B_m);
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if ((x <= -2.6e-135) || ~((x <= 4.7e-208)))
		tmp = -(x / B_m);
	else
		tmp = 1.0 / B_m;
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[Or[LessEqual[x, -2.6e-135], N[Not[LessEqual[x, 4.7e-208]], $MachinePrecision]], (-N[(x / B$95$m), $MachinePrecision]), N[(1.0 / B$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-135} \lor \neg \left(x \leq 4.7 \cdot 10^{-208}\right):\\
\;\;\;\;-\frac{x}{B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.60000000000000004e-135 or 4.7000000000000003e-208 < x

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg39.4%

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

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

    if -2.60000000000000004e-135 < x < 4.7000000000000003e-208

    1. Initial program 61.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. distribute-lft-neg-in61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{1 - x}}{B} \]
    8. Simplified27.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    9. Taylor expanded in x around 0 27.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-135} \lor \neg \left(x \leq 4.7 \cdot 10^{-208}\right):\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 39.2% accurate, 32.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \begin{array}{l} \mathbf{if}\;F \leq 1.2 \cdot 10^{-17}:\\ \;\;\;\;-\frac{x}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
 :precision binary64
 (* B_s (if (<= F 1.2e-17) (- (/ x B_m)) (/ (- 1.0 x) B_m))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= 1.2e-17) {
		tmp = -(x / B_m);
	} else {
		tmp = (1.0 - x) / B_m;
	}
	return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 1.2d-17) then
        tmp = -(x / b_m)
    else
        tmp = (1.0d0 - x) / b_m
    end if
    code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	double tmp;
	if (F <= 1.2e-17) {
		tmp = -(x / B_m);
	} else {
		tmp = (1.0 - x) / B_m;
	}
	return B_s * tmp;
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	tmp = 0
	if F <= 1.2e-17:
		tmp = -(x / B_m)
	else:
		tmp = (1.0 - x) / B_m
	return B_s * tmp
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	tmp = 0.0
	if (F <= 1.2e-17)
		tmp = Float64(-Float64(x / B_m));
	else
		tmp = Float64(Float64(1.0 - x) / B_m);
	end
	return Float64(B_s * tmp)
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp_2 = code(B_s, F, B_m, x)
	tmp = 0.0;
	if (F <= 1.2e-17)
		tmp = -(x / B_m);
	else
		tmp = (1.0 - x) / B_m;
	end
	tmp_2 = B_s * tmp;
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, 1.2e-17], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{-17}:\\
\;\;\;\;-\frac{x}{B\_m}\\

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


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

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. mul-1-neg33.8%

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

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

    if 1.19999999999999993e-17 < F

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.2 \cdot 10^{-17}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 8.9% accurate, 108.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ B_s = \mathsf{copysign}\left(1, B\right) \\ B\_s \cdot \frac{1}{B\_m} \end{array} \]
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x) :precision binary64 (* B_s (/ 1.0 B_m)))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
	return B_s * (1.0 / B_m);
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
    real(8), intent (in) :: b_s
    real(8), intent (in) :: f
    real(8), intent (in) :: b_m
    real(8), intent (in) :: x
    code = b_s * (1.0d0 / b_m)
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
	return B_s * (1.0 / B_m);
}
B_m = math.fabs(B)
B_s = math.copysign(1.0, B)
def code(B_s, F, B_m, x):
	return B_s * (1.0 / B_m)
B_m = abs(B)
B_s = copysign(1.0, B)
function code(B_s, F, B_m, x)
	return Float64(B_s * Float64(1.0 / B_m))
end
B_m = abs(B);
B_s = sign(B) * abs(1.0);
function tmp = code(B_s, F, B_m, x)
	tmp = B_s * (1.0 / B_m);
end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * N[(1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)

\\
B\_s \cdot \frac{1}{B\_m}
\end{array}
Derivation
  1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  9. Taylor expanded in x around 0 10.9%

    \[\leadsto \color{blue}{\frac{1}{B}} \]
  10. Final simplification10.9%

    \[\leadsto \frac{1}{B} \]
  11. Add Preprocessing

Reproduce

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