VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.1% → 99.7%
Time: 21.8s
Alternatives: 22
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 77.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 20000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\

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


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

    1. Initial program 75.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. Taylor expanded in F around -inf 99.7%

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

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

    if -4.0000000000000002e47 < F < 2e7

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e7 < F

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.6%

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 75.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. Taylor expanded in F around -inf 99.7%

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

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

    if -4.4e15 < F < 1e8

    1. Initial program 99.4%

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

    if 1e8 < F

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.6%

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 75.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. Taylor expanded in F around -inf 99.7%

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

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

    if -4e14 < F < 2e7

    1. Initial program 99.4%

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

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

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

    if 2e7 < F

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.6%

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

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

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\

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


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

    1. Initial program 77.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. Simplified84.4%

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

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

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

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

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

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

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

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

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

    if -1.4199999999999999 < F < 1.4199999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

    if 1.4199999999999999 < F

    1. Initial program 63.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. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.8%

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

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

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

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

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t\_0\\

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


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

    1. Initial program 77.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. Simplified84.4%

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

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

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

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

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

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

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

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

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

    if -1.4199999999999999 < F < 1.4199999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4199999999999999 < F

    1. Initial program 63.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. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.42:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.42:\\ \;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t\_0\\

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


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

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

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

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

    if -1.4199999999999999 < F < 1.4199999999999999

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4199999999999999 < F

    1. Initial program 63.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. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.42:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 1.42:\\ \;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.6% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -3.1 \cdot 10^{-70}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.62 \cdot 10^{-65}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_1\\

\mathbf{elif}\;F \leq 920000:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 75.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. Simplified83.2%

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

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

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

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

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

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

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

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

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

    if -4e14 < F < -3.1e-70 or 1.6200000000000001e-65 < F < 9.2e5

    1. Initial program 99.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. Taylor expanded in B around 0 94.4%

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

    if -3.1e-70 < F < 1.6200000000000001e-65

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.2e5 < F

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+14}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.1 \cdot 10^{-70}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.62 \cdot 10^{-65}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 920000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -0.0065:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.3 \cdot 10^{-59}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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

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


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.50000000000000041e125 < F < -0.0064999999999999997

    1. Initial program 96.5%

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{x}{B} + \frac{\color{blue}{-1}}{\sin B} \]
      4. +-commutative71.6%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      5. mul-1-neg71.6%

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

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

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

    if -0.0064999999999999997 < F < -2.29999999999999979e-59

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 82.2%

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

    if -2.29999999999999979e-59 < F < 8.5000000000000007e-36

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around 0 71.5%

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

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

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

    if 8.5000000000000007e-36 < F

    1. Initial program 66.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 46.8%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. *-un-lft-identity31.5%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \cdot 1 \]
      4. sqrt-unprod40.4%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \cdot 1 \]
      6. metadata-eval40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \cdot 1 \]
      7. metadata-eval40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \cdot 1 \]
      8. frac-times40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \cdot 1 \]
      9. rgt-mult-inverse40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{1}{\sin B} \cdot \frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B}} \cdot 1 \]
      10. associate-*l/36.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{1}{\sin B} \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \cdot 1 \]
      11. rgt-mult-inverse36.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B} \cdot \left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      12. associate-*l/36.5%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \cdot 1 \]
      14. add-sqr-sqrt52.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      15. associate-*l/75.5%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \cdot 1 \]
      16. rgt-mult-inverse75.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{1}}{\sin B} \cdot 1 \]
    6. Applied egg-rr75.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{+125}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.0065:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.3 \cdot 10^{-59}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-36}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -4.95 \cdot 10^{-54}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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

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


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

    1. Initial program 77.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. Simplified84.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 84.7%

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

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

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

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

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

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

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

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

    if -0.0029 < F < -4.95000000000000018e-54

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 82.2%

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

    if -4.95000000000000018e-54 < F < 8.5000000000000007e-36

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around 0 71.5%

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

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

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

    if 8.5000000000000007e-36 < F

    1. Initial program 66.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. Simplified82.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0029:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.95 \cdot 10^{-54}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-36}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 77.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -1.2 \cdot 10^{-54}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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

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


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

    1. Initial program 77.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. Simplified84.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 84.7%

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

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

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

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

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

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

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

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

    if -0.00209999999999999987 < F < -1.20000000000000007e-54

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 82.2%

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

    if -1.20000000000000007e-54 < F < 8.5000000000000007e-36

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in F around 0 71.5%

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

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

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

    if 8.5000000000000007e-36 < F

    1. Initial program 66.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 46.8%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. *-un-lft-identity31.5%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \cdot 1 \]
      4. sqrt-unprod40.4%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \cdot 1 \]
      6. metadata-eval40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \cdot 1 \]
      7. metadata-eval40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \cdot 1 \]
      8. frac-times40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \cdot 1 \]
      9. rgt-mult-inverse40.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{1}{\sin B} \cdot \frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B}} \cdot 1 \]
      10. associate-*l/36.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{1}{\sin B} \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \cdot 1 \]
      11. rgt-mult-inverse36.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B} \cdot \left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      12. associate-*l/36.5%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \cdot 1 \]
      14. add-sqr-sqrt52.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      15. associate-*l/75.5%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \cdot 1 \]
      16. rgt-mult-inverse75.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{1}}{\sin B} \cdot 1 \]
    6. Applied egg-rr75.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0021:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.2 \cdot 10^{-54}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{-36}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 91.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.085:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

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


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

    1. Initial program 77.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. Simplified84.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 84.7%

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

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

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

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

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

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

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

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

    if -0.0064999999999999997 < F < 0.0850000000000000061

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0850000000000000061 < F

    1. Initial program 63.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. Simplified80.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 80.8%

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

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

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

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

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

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

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

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

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

Alternative 12: 65.5% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.6 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -0.006:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-246}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{F}{B}}{F} - t\_0\\ \mathbf{elif}\;F \leq 0.0019:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.55 \cdot 10^{+77} \lor \neg \left(F \leq 3.9 \cdot 10^{+125}\right):\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.6e+126)
     (- (/ -1.0 B) t_0)
     (if (<= F -0.006)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -5.6e-246)
         (/ (- (* F (sqrt 0.5)) x) B)
         (if (<= F 6e-202)
           (- (/ (/ F B) F) t_0)
           (if (<= F 0.0019)
             (- (* F (/ (sqrt 0.5) B)) (/ x B))
             (if (or (<= F 4.55e+77) (not (<= F 3.9e+125)))
               (- (/ 1.0 (sin B)) (/ x B))
               (- (* F (/ (/ 1.0 F) B)) t_0)))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.6e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.006) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -5.6e-246) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else if (F <= 6e-202) {
		tmp = ((F / B) / F) - t_0;
	} else if (F <= 0.0019) {
		tmp = (F * (sqrt(0.5) / B)) - (x / B);
	} else if ((F <= 4.55e+77) || !(F <= 3.9e+125)) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = (F * ((1.0 / F) / B)) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-1.6d+126)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-0.006d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-5.6d-246)) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else if (f <= 6d-202) then
        tmp = ((f / b) / f) - t_0
    else if (f <= 0.0019d0) then
        tmp = (f * (sqrt(0.5d0) / b)) - (x / b)
    else if ((f <= 4.55d+77) .or. (.not. (f <= 3.9d+125))) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = (f * ((1.0d0 / f) / b)) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -1.6e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.006) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -5.6e-246) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else if (F <= 6e-202) {
		tmp = ((F / B) / F) - t_0;
	} else if (F <= 0.0019) {
		tmp = (F * (Math.sqrt(0.5) / B)) - (x / B);
	} else if ((F <= 4.55e+77) || !(F <= 3.9e+125)) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = (F * ((1.0 / F) / B)) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.6e+126:
		tmp = (-1.0 / B) - t_0
	elif F <= -0.006:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -5.6e-246:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	elif F <= 6e-202:
		tmp = ((F / B) / F) - t_0
	elif F <= 0.0019:
		tmp = (F * (math.sqrt(0.5) / B)) - (x / B)
	elif (F <= 4.55e+77) or not (F <= 3.9e+125):
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = (F * ((1.0 / F) / B)) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.6e+126)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -0.006)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -5.6e-246)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	elseif (F <= 6e-202)
		tmp = Float64(Float64(Float64(F / B) / F) - t_0);
	elseif (F <= 0.0019)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - Float64(x / B));
	elseif ((F <= 4.55e+77) || !(F <= 3.9e+125))
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(Float64(F * Float64(Float64(1.0 / F) / B)) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.6e+126)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -0.006)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -5.6e-246)
		tmp = ((F * sqrt(0.5)) - x) / B;
	elseif (F <= 6e-202)
		tmp = ((F / B) / F) - t_0;
	elseif (F <= 0.0019)
		tmp = (F * (sqrt(0.5) / B)) - (x / B);
	elseif ((F <= 4.55e+77) || ~((F <= 3.9e+125)))
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = (F * ((1.0 / F) / B)) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.6e+126], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -0.006], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.6e-246], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6e-202], N[(N[(N[(F / B), $MachinePrecision] / F), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0019], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.55e+77], N[Not[LessEqual[F, 3.9e+125]], $MachinePrecision]], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -0.006:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -5.6 \cdot 10^{-246}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

\mathbf{elif}\;F \leq 6 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{F}{B}}{F} - t\_0\\

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

\mathbf{elif}\;F \leq 4.55 \cdot 10^{+77} \lor \neg \left(F \leq 3.9 \cdot 10^{+125}\right):\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{B} - t\_0\\


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e126 < F < -0.0060000000000000001

    1. Initial program 96.5%

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{x}{B} + \frac{\color{blue}{-1}}{\sin B} \]
      4. +-commutative71.6%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      5. mul-1-neg71.6%

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

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

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

    if -0.0060000000000000001 < F < -5.5999999999999999e-246

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 62.0%

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

    if -5.5999999999999999e-246 < F < 6.00000000000000022e-202

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{B \cdot F}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. *-commutative45.0%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified45.0%

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

        \[\leadsto \color{blue}{\frac{F}{F \cdot B}} - \frac{x}{\tan B} \]
      2. *-commutative48.5%

        \[\leadsto \frac{F}{\color{blue}{B \cdot F}} - \frac{x}{\tan B} \]
      3. associate-/r*74.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F}} - \frac{x}{\tan B} \]
    14. Applied egg-rr74.3%

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

    if 6.00000000000000022e-202 < F < 0.0019

    1. Initial program 99.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. Simplified99.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 48.2%

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

    if 0.0019 < F < 4.55000000000000007e77 or 3.9000000000000002e125 < F

    1. Initial program 59.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 50.6%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. *-un-lft-identity35.9%

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \cdot 1 \]
      6. metadata-eval47.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \cdot 1 \]
      7. metadata-eval47.4%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \cdot 1 \]
      9. rgt-mult-inverse47.5%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{1}{\sin B} \cdot \frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B}} \cdot 1 \]
      10. associate-*l/42.0%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B} \cdot \left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      12. associate-*l/41.9%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \cdot 1 \]
      14. add-sqr-sqrt57.3%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      15. associate-*l/82.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \cdot 1 \]
      16. rgt-mult-inverse82.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{1}}{\sin B} \cdot 1 \]
    6. Applied egg-rr82.6%

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

    if 4.55000000000000007e77 < F < 3.9000000000000002e125

    1. Initial program 77.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.006:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.6 \cdot 10^{-246}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{F}{B}}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.0019:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.55 \cdot 10^{+77} \lor \neg \left(F \leq 3.9 \cdot 10^{+125}\right):\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{\frac{1}{F}}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 65.6% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.18 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -0.0065:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.62 \cdot 10^{-245}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{F}{B}}{F} - t\_0\\ \mathbf{elif}\;F \leq 0.455:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+76} \lor \neg \left(F \leq 9.2 \cdot 10^{+132}\right):\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.18e+126)
     (- (/ -1.0 B) t_0)
     (if (<= F -0.0065)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -1.62e-245)
         (/ (- (* F (sqrt 0.5)) x) B)
         (if (<= F 5e-202)
           (- (/ (/ F B) F) t_0)
           (if (<= F 0.455)
             (- (* F (/ (sqrt 0.5) B)) (/ x B))
             (if (or (<= F 4.5e+76) (not (<= F 9.2e+132)))
               (- (/ 1.0 (sin B)) (/ x B))
               (- (/ 1.0 B) t_0)))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.18e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.0065) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.62e-245) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else if (F <= 5e-202) {
		tmp = ((F / B) / F) - t_0;
	} else if (F <= 0.455) {
		tmp = (F * (sqrt(0.5) / B)) - (x / B);
	} else if ((F <= 4.5e+76) || !(F <= 9.2e+132)) {
		tmp = (1.0 / sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-1.18d+126)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-0.0065d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.62d-245)) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else if (f <= 5d-202) then
        tmp = ((f / b) / f) - t_0
    else if (f <= 0.455d0) then
        tmp = (f * (sqrt(0.5d0) / b)) - (x / b)
    else if ((f <= 4.5d+76) .or. (.not. (f <= 9.2d+132))) then
        tmp = (1.0d0 / sin(b)) - (x / b)
    else
        tmp = (1.0d0 / b) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -1.18e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.0065) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.62e-245) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else if (F <= 5e-202) {
		tmp = ((F / B) / F) - t_0;
	} else if (F <= 0.455) {
		tmp = (F * (Math.sqrt(0.5) / B)) - (x / B);
	} else if ((F <= 4.5e+76) || !(F <= 9.2e+132)) {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.18e+126:
		tmp = (-1.0 / B) - t_0
	elif F <= -0.0065:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.62e-245:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	elif F <= 5e-202:
		tmp = ((F / B) / F) - t_0
	elif F <= 0.455:
		tmp = (F * (math.sqrt(0.5) / B)) - (x / B)
	elif (F <= 4.5e+76) or not (F <= 9.2e+132):
		tmp = (1.0 / math.sin(B)) - (x / B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.18e+126)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -0.0065)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.62e-245)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	elseif (F <= 5e-202)
		tmp = Float64(Float64(Float64(F / B) / F) - t_0);
	elseif (F <= 0.455)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - Float64(x / B));
	elseif ((F <= 4.5e+76) || !(F <= 9.2e+132))
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.18e+126)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -0.0065)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.62e-245)
		tmp = ((F * sqrt(0.5)) - x) / B;
	elseif (F <= 5e-202)
		tmp = ((F / B) / F) - t_0;
	elseif (F <= 0.455)
		tmp = (F * (sqrt(0.5) / B)) - (x / B);
	elseif ((F <= 4.5e+76) || ~((F <= 9.2e+132)))
		tmp = (1.0 / sin(B)) - (x / B);
	else
		tmp = (1.0 / B) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.18e+126], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -0.0065], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.62e-245], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5e-202], N[(N[(N[(F / B), $MachinePrecision] / F), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.455], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.5e+76], N[Not[LessEqual[F, 9.2e+132]], $MachinePrecision]], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -0.0065:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.62 \cdot 10^{-245}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

\mathbf{elif}\;F \leq 5 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{F}{B}}{F} - t\_0\\

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

\mathbf{elif}\;F \leq 4.5 \cdot 10^{+76} \lor \neg \left(F \leq 9.2 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\

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


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.18e126 < F < -0.0064999999999999997

    1. Initial program 96.5%

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{x}{B} + \frac{\color{blue}{-1}}{\sin B} \]
      4. +-commutative71.6%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      5. mul-1-neg71.6%

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

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

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

    if -0.0064999999999999997 < F < -1.6199999999999999e-245

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 62.0%

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

    if -1.6199999999999999e-245 < F < 4.99999999999999973e-202

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{B \cdot F}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. *-commutative45.0%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified45.0%

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

        \[\leadsto \color{blue}{\frac{F}{F \cdot B}} - \frac{x}{\tan B} \]
      2. *-commutative48.5%

        \[\leadsto \frac{F}{\color{blue}{B \cdot F}} - \frac{x}{\tan B} \]
      3. associate-/r*74.3%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F}} - \frac{x}{\tan B} \]
    14. Applied egg-rr74.3%

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

    if 4.99999999999999973e-202 < F < 0.455000000000000016

    1. Initial program 99.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. Simplified99.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 48.2%

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

    if 0.455000000000000016 < F < 4.4999999999999997e76 or 9.2000000000000006e132 < F

    1. Initial program 59.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 50.6%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. *-un-lft-identity35.9%

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \cdot 1 \]
      6. metadata-eval47.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \cdot 1 \]
      7. metadata-eval47.4%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \cdot 1 \]
      9. rgt-mult-inverse47.5%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{1}{\sin B} \cdot \frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B}} \cdot 1 \]
      10. associate-*l/42.0%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B} \cdot \left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      12. associate-*l/41.9%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \cdot 1 \]
      14. add-sqr-sqrt57.3%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot 1 \]
      15. associate-*l/82.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \cdot 1 \]
      16. rgt-mult-inverse82.6%

        \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{1}}{\sin B} \cdot 1 \]
    6. Applied egg-rr82.6%

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

    if 4.4999999999999997e76 < F < 9.2000000000000006e132

    1. Initial program 77.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified83.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.18 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.0065:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.62 \cdot 10^{-245}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-202}:\\ \;\;\;\;\frac{\frac{F}{B}}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.455:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+76} \lor \neg \left(F \leq 9.2 \cdot 10^{+132}\right):\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 64.3% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -0.0065:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -7.5 \cdot 10^{-245}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-212}:\\
\;\;\;\;\frac{\frac{F}{B}}{F} - t\_0\\

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


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

    1. Initial program 62.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified65.2%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around -inf 81.6%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -1.65000000000000006e126 < F < -0.0064999999999999997

    1. Initial program 96.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 90.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 71.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around 0 71.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. sub-neg71.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{\sin B}\right)} \]
      2. distribute-neg-frac71.6%

        \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{-1}{\sin B}} \]
      3. metadata-eval71.6%

        \[\leadsto -1 \cdot \frac{x}{B} + \frac{\color{blue}{-1}}{\sin B} \]
      4. +-commutative71.6%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      5. mul-1-neg71.6%

        \[\leadsto \frac{-1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      6. sub-neg71.6%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    7. Simplified71.6%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -0.0064999999999999997 < F < -7.5000000000000003e-245

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 81.9%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/82.0%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity82.0%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative82.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow282.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine82.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-182.0%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval82.0%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr82.0%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square82.0%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt81.7%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr81.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt82.0%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified82.0%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around 0 81.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 62.0%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5} - x}{B}} \]

    if -7.5000000000000003e-245 < F < 4.1999999999999999e-212

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.7%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 92.9%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/92.9%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity92.9%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative92.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow292.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine92.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-192.9%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval92.9%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr92.9%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square92.9%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt92.9%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr92.9%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt92.9%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified92.9%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around inf 46.3%

      \[\leadsto F \cdot \color{blue}{\frac{1}{B \cdot F}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. *-commutative46.3%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified46.3%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot B}} - \frac{x}{\tan B} \]
    13. Step-by-step derivation
      1. un-div-inv50.2%

        \[\leadsto \color{blue}{\frac{F}{F \cdot B}} - \frac{x}{\tan B} \]
      2. *-commutative50.2%

        \[\leadsto \frac{F}{\color{blue}{B \cdot F}} - \frac{x}{\tan B} \]
      3. associate-/r*71.4%

        \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F}} - \frac{x}{\tan B} \]
    14. Applied egg-rr71.4%

      \[\leadsto \color{blue}{\frac{\frac{F}{B}}{F}} - \frac{x}{\tan B} \]

    if 4.1999999999999999e-212 < F

    1. Initial program 76.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified87.3%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 87.3%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/87.4%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity87.4%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative87.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow287.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine87.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified87.4%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 67.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/67.3%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity67.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative67.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow267.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine67.3%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-167.3%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval67.3%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr67.3%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square67.3%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt67.2%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr67.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt67.3%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified67.3%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around inf 57.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{B \cdot F}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. *-commutative57.7%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified57.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot B}} - \frac{x}{\tan B} \]
    13. Taylor expanded in F around 0 63.2%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification67.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.65 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.0065:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{-245}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-212}:\\ \;\;\;\;\frac{\frac{F}{B}}{F} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.1% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.75 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -0.0065:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-240}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.75e+126)
     (- (/ -1.0 B) t_0)
     (if (<= F -0.0065)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -2.1e-240) (/ (- (* F (sqrt 0.5)) x) B) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.75e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.0065) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -2.1e-240) {
		tmp = ((F * sqrt(0.5)) - x) / B;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-1.75d+126)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-0.0065d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-2.1d-240)) then
        tmp = ((f * sqrt(0.5d0)) - x) / b
    else
        tmp = (1.0d0 / b) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -1.75e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.0065) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -2.1e-240) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.75e+126:
		tmp = (-1.0 / B) - t_0
	elif F <= -0.0065:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -2.1e-240:
		tmp = ((F * math.sqrt(0.5)) - x) / B
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.75e+126)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -0.0065)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -2.1e-240)
		tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B);
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.75e+126)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -0.0065)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -2.1e-240)
		tmp = ((F * sqrt(0.5)) - x) / B;
	else
		tmp = (1.0 / B) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.75e+126], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -0.0065], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.1e-240], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.75 \cdot 10^{+126}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{elif}\;F \leq -0.0065:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -2.1 \cdot 10^{-240}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.7500000000000001e126

    1. Initial program 62.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified72.9%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 72.9%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/72.9%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity72.9%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative72.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow272.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine72.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified72.9%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 65.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/65.2%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity65.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative65.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow265.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine65.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-165.2%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval65.2%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr65.2%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square65.2%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt65.2%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr65.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt65.2%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified65.2%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around -inf 81.6%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -1.7500000000000001e126 < F < -0.0064999999999999997

    1. Initial program 96.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 90.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 71.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around 0 71.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. sub-neg71.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{\sin B}\right)} \]
      2. distribute-neg-frac71.6%

        \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{-1}{\sin B}} \]
      3. metadata-eval71.6%

        \[\leadsto -1 \cdot \frac{x}{B} + \frac{\color{blue}{-1}}{\sin B} \]
      4. +-commutative71.6%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      5. mul-1-neg71.6%

        \[\leadsto \frac{-1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      6. sub-neg71.6%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    7. Simplified71.6%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -0.0064999999999999997 < F < -2.09999999999999994e-240

    1. Initial program 99.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified99.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 99.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/99.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity99.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow299.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine99.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 81.9%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/82.0%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity82.0%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative82.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow282.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine82.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-182.0%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval82.0%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr82.0%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square82.0%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt81.7%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr81.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt82.0%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified82.0%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around 0 81.6%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{B} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 62.0%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5} - x}{B}} \]

    if -2.09999999999999994e-240 < F

    1. Initial program 80.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. Simplified89.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 89.8%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/89.8%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity89.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative89.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow289.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine89.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified89.8%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 72.3%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/72.4%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity72.4%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative72.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow272.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine72.4%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-172.4%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval72.4%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr72.4%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square72.4%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt72.3%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr72.3%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt72.4%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified72.4%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around inf 55.4%

      \[\leadsto F \cdot \color{blue}{\frac{1}{B \cdot F}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. *-commutative55.4%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified55.4%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot B}} - \frac{x}{\tan B} \]
    13. Taylor expanded in F around 0 61.4%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification66.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.75 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.0065:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.1 \cdot 10^{-240}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 56.7% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-7} \lor \neg \left(x \leq 2.9 \cdot 10^{-120}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -1.15e-7) (not (<= x 2.9e-120)))
   (- (/ -1.0 B) (/ x (tan B)))
   (- (/ -1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.15e-7) || !(x <= 2.9e-120)) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else {
		tmp = (-1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-1.15d-7)) .or. (.not. (x <= 2.9d-120))) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.15e-7) || !(x <= 2.9e-120)) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -1.15e-7) or not (x <= 2.9e-120):
		tmp = (-1.0 / B) - (x / math.tan(B))
	else:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -1.15e-7) || !(x <= 2.9e-120))
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -1.15e-7) || ~((x <= 2.9e-120)))
		tmp = (-1.0 / B) - (x / tan(B));
	else
		tmp = (-1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.15e-7], N[Not[LessEqual[x, 2.9e-120]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-7} \lor \neg \left(x \leq 2.9 \cdot 10^{-120}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.14999999999999997e-7 or 2.9e-120 < x

    1. Initial program 84.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. Simplified94.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 94.0%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/94.0%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity94.0%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative94.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow294.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine94.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified94.0%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 90.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/90.6%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity90.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative90.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow290.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine90.6%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-190.6%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval90.6%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr90.6%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square90.6%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt90.6%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr90.6%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt90.6%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified90.6%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around -inf 88.0%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -1.14999999999999997e-7 < x < 2.9e-120

    1. Initial program 82.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. Add Preprocessing
    3. Taylor expanded in F around -inf 25.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 25.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around 0 25.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. sub-neg25.3%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{\sin B}\right)} \]
      2. distribute-neg-frac25.3%

        \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{-1}{\sin B}} \]
      3. metadata-eval25.3%

        \[\leadsto -1 \cdot \frac{x}{B} + \frac{\color{blue}{-1}}{\sin B} \]
      4. +-commutative25.3%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      5. mul-1-neg25.3%

        \[\leadsto \frac{-1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      6. sub-neg25.3%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    7. Simplified25.3%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-7} \lor \neg \left(x \leq 2.9 \cdot 10^{-120}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 61.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.18 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -1.95 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.18e+126)
     (- (/ -1.0 B) t_0)
     (if (<= F -1.95e-52) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.18e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -1.95e-52) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / tan(b)
    if (f <= (-1.18d+126)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-1.95d-52)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else
        tmp = (1.0d0 / b) - t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = x / Math.tan(B);
	double tmp;
	if (F <= -1.18e+126) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -1.95e-52) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= -1.18e+126:
		tmp = (-1.0 / B) - t_0
	elif F <= -1.95e-52:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.18e+126)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -1.95e-52)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - t_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -1.18e+126)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -1.95e-52)
		tmp = (-1.0 / sin(B)) - (x / B);
	else
		tmp = (1.0 / B) - t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.18e+126], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.95e-52], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.18 \cdot 10^{+126}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

\mathbf{elif}\;F \leq -1.95 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.18e126

    1. Initial program 62.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified72.9%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 72.9%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/72.9%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity72.9%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative72.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow272.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine72.9%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified72.9%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 65.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/65.2%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity65.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative65.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow265.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine65.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-165.2%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval65.2%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr65.2%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square65.2%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt65.2%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr65.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt65.2%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified65.2%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around -inf 81.6%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]

    if -1.18e126 < F < -1.95000000000000009e-52

    1. Initial program 97.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. Taylor expanded in F around -inf 76.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 63.1%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around 0 63.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{\sin B}} \]
    6. Step-by-step derivation
      1. sub-neg63.1%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{\sin B}\right)} \]
      2. distribute-neg-frac63.1%

        \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{-1}{\sin B}} \]
      3. metadata-eval63.1%

        \[\leadsto -1 \cdot \frac{x}{B} + \frac{\color{blue}{-1}}{\sin B} \]
      4. +-commutative63.1%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      5. mul-1-neg63.1%

        \[\leadsto \frac{-1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      6. sub-neg63.1%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    7. Simplified63.1%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -1.95000000000000009e-52 < F

    1. Initial program 84.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. Simplified91.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}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 91.7%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/91.8%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity91.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative91.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow291.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine91.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified91.8%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 74.2%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/74.2%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity74.2%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative74.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow274.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine74.2%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-174.2%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval74.2%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr74.2%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square74.2%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt74.1%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr74.1%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt74.2%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified74.2%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around inf 52.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{B \cdot F}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. *-commutative52.7%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified52.7%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot B}} - \frac{x}{\tan B} \]
    13. Taylor expanded in F around 0 57.8%

      \[\leadsto \color{blue}{\frac{1}{B}} - \frac{x}{\tan B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.18 \cdot 10^{+126}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.95 \cdot 10^{-52}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 53.7% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} - \frac{x}{\tan B} \end{array} \]
(FPCore (F B x) :precision binary64 (- (/ -1.0 B) (/ x (tan B))))
double code(double F, double B, double x) {
	return (-1.0 / B) - (x / tan(B));
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = ((-1.0d0) / b) - (x / tan(b))
end function
public static double code(double F, double B, double x) {
	return (-1.0 / B) - (x / Math.tan(B));
}
def code(F, B, x):
	return (-1.0 / B) - (x / math.tan(B))
function code(F, B, x)
	return Float64(Float64(-1.0 / B) - Float64(x / tan(B)))
end
function tmp = code(F, B, x)
	tmp = (-1.0 / B) - (x / tan(B));
end
code[F_, B_, x_] := N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B} - \frac{x}{\tan B}
\end{array}
Derivation
  1. Initial program 83.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. Simplified90.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}} \]
  3. Add Preprocessing
  4. Taylor expanded in x around 0 90.0%

    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
  5. Step-by-step derivation
    1. associate-*l/90.1%

      \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
    2. *-lft-identity90.1%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
    3. +-commutative90.1%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
    4. unpow290.1%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
    5. fma-undefine90.1%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
  6. Simplified90.1%

    \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
  7. Taylor expanded in B around 0 71.0%

    \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
  8. Step-by-step derivation
    1. associate-*l/71.1%

      \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
    2. *-lft-identity71.1%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
    3. +-commutative71.1%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
    4. unpow271.1%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
    5. fma-undefine71.1%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
    6. unpow-171.1%

      \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
    7. metadata-eval71.1%

      \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
    8. pow-sqr71.1%

      \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
    9. rem-sqrt-square71.1%

      \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
    10. rem-square-sqrt70.9%

      \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
    11. fabs-sqr70.9%

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
    12. rem-square-sqrt71.1%

      \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
  9. Simplified71.1%

    \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
  10. Taylor expanded in F around -inf 53.4%

    \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]
  11. Final simplification53.4%

    \[\leadsto \frac{-1}{B} - \frac{x}{\tan B} \]
  12. Add Preprocessing

Alternative 19: 43.8% accurate, 15.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-30}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-67}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e-30)
   (/ (- -1.0 x) B)
   (if (<= F 1.2e-67) (/ x (- B)) (- (* F (/ 1.0 (* F B))) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-30) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.2e-67) {
		tmp = x / -B;
	} else {
		tmp = (F * (1.0 / (F * B))) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-3d-30)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.2d-67) then
        tmp = x / -b
    else
        tmp = (f * (1.0d0 / (f * b))) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-30) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.2e-67) {
		tmp = x / -B;
	} else {
		tmp = (F * (1.0 / (F * B))) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e-30:
		tmp = (-1.0 - x) / B
	elif F <= 1.2e-67:
		tmp = x / -B
	else:
		tmp = (F * (1.0 / (F * B))) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e-30)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.2e-67)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3e-30)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.2e-67)
		tmp = x / -B;
	else
		tmp = (F * (1.0 / (F * B))) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e-30], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.2e-67], N[(x / (-B)), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.2 \cdot 10^{-67}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.9999999999999999e-30

    1. Initial program 80.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. Taylor expanded in F around -inf 89.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 63.5%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in B around 0 41.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg41.9%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac241.9%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Simplified41.9%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]

    if -2.9999999999999999e-30 < F < 1.2e-67

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 38.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 21.7%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around inf 39.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg39.2%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac239.2%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified39.2%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]

    if 1.2e-67 < F

    1. Initial program 68.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. Simplified83.4%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around 0 83.5%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-*l/83.5%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity83.5%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative83.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow283.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine83.5%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    6. Simplified83.5%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 63.9%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. associate-*l/64.0%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{B}} - \frac{x}{\tan B} \]
      2. *-lft-identity64.0%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{B} - \frac{x}{\tan B} \]
      3. +-commutative64.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{B} - \frac{x}{\tan B} \]
      4. unpow264.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{B} - \frac{x}{\tan B} \]
      5. fma-undefine64.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{B} - \frac{x}{\tan B} \]
      6. unpow-164.0%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}}{B} - \frac{x}{\tan B} \]
      7. metadata-eval64.0%

        \[\leadsto F \cdot \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{\color{blue}{\left(2 \cdot -0.5\right)}}}}{B} - \frac{x}{\tan B} \]
      8. pow-sqr63.9%

        \[\leadsto F \cdot \frac{\sqrt{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      9. rem-sqrt-square63.9%

        \[\leadsto F \cdot \frac{\color{blue}{\left|{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\right|}}{B} - \frac{x}{\tan B} \]
      10. rem-square-sqrt63.8%

        \[\leadsto F \cdot \frac{\left|\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}\right|}{B} - \frac{x}{\tan B} \]
      11. fabs-sqr63.8%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}}{B} - \frac{x}{\tan B} \]
      12. rem-square-sqrt63.9%

        \[\leadsto F \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}}{B} - \frac{x}{\tan B} \]
    9. Simplified63.9%

      \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{B}} - \frac{x}{\tan B} \]
    10. Taylor expanded in F around inf 67.0%

      \[\leadsto F \cdot \color{blue}{\frac{1}{B \cdot F}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. *-commutative67.0%

        \[\leadsto F \cdot \frac{1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    12. Simplified67.0%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot B}} - \frac{x}{\tan B} \]
    13. Taylor expanded in B around 0 50.1%

      \[\leadsto F \cdot \frac{1}{F \cdot B} - \frac{x}{\color{blue}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-30}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-67}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 37.0% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -9.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -9.2e-30) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.2e-30) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-9.2d-30)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = x / -b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -9.2e-30) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -9.2e-30:
		tmp = (-1.0 - x) / B
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -9.2e-30)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(x / Float64(-B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -9.2e-30)
		tmp = (-1.0 - x) / B;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -9.2e-30], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -9.19999999999999937e-30

    1. Initial program 80.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. Taylor expanded in F around -inf 89.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 63.5%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in B around 0 41.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg41.9%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac241.9%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Simplified41.9%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]

    if -9.19999999999999937e-30 < F

    1. Initial program 84.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. Add Preprocessing
    3. Taylor expanded in F around -inf 41.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 25.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around inf 34.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg34.9%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac234.9%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified34.9%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 29.4% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{x}{-B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ x (- B)))
double code(double F, double B, double x) {
	return x / -B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = x / -b
end function
public static double code(double F, double B, double x) {
	return x / -B;
}
def code(F, B, x):
	return x / -B
function code(F, B, x)
	return Float64(x / Float64(-B))
end
function tmp = code(F, B, x)
	tmp = x / -B;
end
code[F_, B_, x_] := N[(x / (-B)), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{-B}
\end{array}
Derivation
  1. Initial program 83.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. Taylor expanded in F around -inf 57.0%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  4. Taylor expanded in B around 0 37.7%

    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
  5. Taylor expanded in x around inf 31.1%

    \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
  6. Step-by-step derivation
    1. mul-1-neg31.1%

      \[\leadsto \color{blue}{-\frac{x}{B}} \]
    2. distribute-neg-frac231.1%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]
  7. Simplified31.1%

    \[\leadsto \color{blue}{\frac{x}{-B}} \]
  8. Final simplification31.1%

    \[\leadsto \frac{x}{-B} \]
  9. Add Preprocessing

Alternative 22: 2.8% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ x B))
double code(double F, double B, double x) {
	return x / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = x / b
end function
public static double code(double F, double B, double x) {
	return x / B;
}
def code(F, B, x):
	return x / B
function code(F, B, x)
	return Float64(x / B)
end
function tmp = code(F, B, x)
	tmp = x / B;
end
code[F_, B_, x_] := N[(x / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{B}
\end{array}
Derivation
  1. Initial program 83.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. Taylor expanded in F around -inf 57.0%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  4. Taylor expanded in B around 0 37.7%

    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
  5. Step-by-step derivation
    1. log1p-expm1-u21.3%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\right)\right)} \]
    2. add-sqr-sqrt14.1%

      \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{-\frac{x}{B}} \cdot \sqrt{-\frac{x}{B}}} + \frac{-1}{\sin B}\right)\right) \]
    3. sqrt-unprod16.3%

      \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{\left(-\frac{x}{B}\right) \cdot \left(-\frac{x}{B}\right)}} + \frac{-1}{\sin B}\right)\right) \]
    4. sqr-neg16.3%

      \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\color{blue}{\frac{x}{B} \cdot \frac{x}{B}}} + \frac{-1}{\sin B}\right)\right) \]
    5. sqrt-unprod6.4%

      \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{\frac{x}{B}} \cdot \sqrt{\frac{x}{B}}} + \frac{-1}{\sin B}\right)\right) \]
    6. add-sqr-sqrt9.4%

      \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\frac{x}{B}} + \frac{-1}{\sin B}\right)\right) \]
  6. Applied egg-rr9.4%

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{B} + \frac{-1}{\sin B}\right)\right)} \]
  7. Taylor expanded in x around inf 2.6%

    \[\leadsto \color{blue}{\frac{x}{B}} \]
  8. Final simplification2.6%

    \[\leadsto \frac{x}{B} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024081 
(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))))))