VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.1% → 99.7%
Time: 18.1s
Alternatives: 27
Speedup: 1.4×

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 27 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.6× speedup?

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

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

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

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


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

    1. Initial program 52.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. Simplified67.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 F around -inf 99.7%

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

    if -1.7e16 < F < 1.99999999999999993e90

    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

    if 1.99999999999999993e90 < F

    1. Initial program 44.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified64.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 F around inf 99.8%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

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

      \[\leadsto \frac{1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

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

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

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

Alternative 2: 99.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;F \leq 3.2 \cdot 10^{+63}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\

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


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

    1. Initial program 52.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. Simplified67.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 F around -inf 99.7%

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

    if -5e19 < F < 3.20000000000000011e63

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. sub-neg99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.20000000000000011e63 < F

    1. Initial program 48.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. Simplified67.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 F around inf 99.8%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{1}{\frac{\tan B}{x}}} \]
      2. inv-pow99.8%

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

      \[\leadsto \frac{1}{\sin B} - \color{blue}{{\left(\frac{\tan B}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-199.8%

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

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

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

Alternative 3: 99.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - t\_0\\

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

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


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

    1. Initial program 44.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\color{blue}{-1 \cdot \left(F \cdot \sin B\right)}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. associate-*r*99.7%

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

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

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

    if -1.49999999999999992e69 < F < 2e7

    1. Initial program 98.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. 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} \]

    if 2e7 < F

    1. Initial program 57.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. Simplified73.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 F around inf 99.8%

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      2. *-commutative99.8%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
      2. sub-div99.8%

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 106000000:\\
\;\;\;\;\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 - x \cdot \cos B}{\sin B}\\


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

    1. Initial program 52.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. Simplified67.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 F around -inf 99.7%

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

    if -1.65e16 < F < 1.06e8

    1. Initial program 99.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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. neg-mul-199.5%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\frac{\tan B}{x}}} + \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.3%

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

    if 1.06e8 < F

    1. Initial program 57.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. Simplified73.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 F around inf 99.8%

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      2. *-commutative99.8%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
      2. sub-div99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.65 \cdot 10^{+16}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 106000000:\\ \;\;\;\;\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 - x \cdot \cos B}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 6.2:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t\_0\\

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


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

    1. Initial program 53.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. Simplified67.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 F around -inf 99.7%

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

    if -5e7 < F < 6.20000000000000018

    1. Initial program 99.3%

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

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

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

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

    if 6.20000000000000018 < F

    1. Initial program 58.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.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 F around inf 98.7%

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

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

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

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

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

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

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

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

Alternative 6: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 6.2:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t\_0\\

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


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

    1. Initial program 53.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. Simplified67.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 F around -inf 99.7%

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

    if -5e7 < F < 6.20000000000000018

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.20000000000000018 < F

    1. Initial program 58.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified74.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 F around inf 98.7%

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

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

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

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

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

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

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

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

Alternative 7: 98.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 53.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. Simplified67.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 F around -inf 99.7%

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

    if -5e7 < F < 1.3999999999999999

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      2. *-commutative98.5%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
      2. sub-div98.5%

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

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

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

Alternative 8: 91.3% 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 -19000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_1\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-76}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-181}:\\ \;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}} - t\_1\\ \mathbf{elif}\;F \leq 3300000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\ \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 -19000.0)
     (- (/ -1.0 (sin B)) t_1)
     (if (<= F -4.2e-76)
       t_0
       (if (<= F 1.75e-181)
         (- (/ F (* B (sqrt (+ 2.0 (* x 2.0))))) t_1)
         (if (<= F 3300000.0) t_0 (/ (- 1.0 (* x (cos B))) (sin B))))))))
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 <= -19000.0) {
		tmp = (-1.0 / sin(B)) - t_1;
	} else if (F <= -4.2e-76) {
		tmp = t_0;
	} else if (F <= 1.75e-181) {
		tmp = (F / (B * sqrt((2.0 + (x * 2.0))))) - t_1;
	} else if (F <= 3300000.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 - (x * cos(B))) / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: 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 <= (-19000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_1
    else if (f <= (-4.2d-76)) then
        tmp = t_0
    else if (f <= 1.75d-181) then
        tmp = (f / (b * sqrt((2.0d0 + (x * 2.0d0))))) - t_1
    else if (f <= 3300000.0d0) then
        tmp = t_0
    else
        tmp = (1.0d0 - (x * cos(b))) / sin(b)
    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 <= -19000.0) {
		tmp = (-1.0 / Math.sin(B)) - t_1;
	} else if (F <= -4.2e-76) {
		tmp = t_0;
	} else if (F <= 1.75e-181) {
		tmp = (F / (B * Math.sqrt((2.0 + (x * 2.0))))) - t_1;
	} else if (F <= 3300000.0) {
		tmp = t_0;
	} else {
		tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
	}
	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 <= -19000.0:
		tmp = (-1.0 / math.sin(B)) - t_1
	elif F <= -4.2e-76:
		tmp = t_0
	elif F <= 1.75e-181:
		tmp = (F / (B * math.sqrt((2.0 + (x * 2.0))))) - t_1
	elif F <= 3300000.0:
		tmp = t_0
	else:
		tmp = (1.0 - (x * math.cos(B))) / math.sin(B)
	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 <= -19000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
	elseif (F <= -4.2e-76)
		tmp = t_0;
	elseif (F <= 1.75e-181)
		tmp = Float64(Float64(F / Float64(B * sqrt(Float64(2.0 + Float64(x * 2.0))))) - t_1);
	elseif (F <= 3300000.0)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B));
	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 <= -19000.0)
		tmp = (-1.0 / sin(B)) - t_1;
	elseif (F <= -4.2e-76)
		tmp = t_0;
	elseif (F <= 1.75e-181)
		tmp = (F / (B * sqrt((2.0 + (x * 2.0))))) - t_1;
	elseif (F <= 3300000.0)
		tmp = t_0;
	else
		tmp = (1.0 - (x * cos(B))) / sin(B);
	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, -19000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -4.2e-76], t$95$0, If[LessEqual[F, 1.75e-181], N[(N[(F / N[(B * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 3300000.0], t$95$0, N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $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 -19000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

\mathbf{elif}\;F \leq -4.2 \cdot 10^{-76}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.75 \cdot 10^{-181}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}} - t\_1\\

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

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


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

    1. Initial program 53.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified68.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 F around -inf 99.7%

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

    if -19000 < F < -4.19999999999999985e-76 or 1.74999999999999998e-181 < F < 3.3e6

    1. Initial program 99.3%

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

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

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

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

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

    if -4.19999999999999985e-76 < F < 1.74999999999999998e-181

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\frac{\sin B}{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

    if 3.3e6 < F

    1. Initial program 57.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. Simplified73.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 F around inf 99.8%

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      2. *-commutative99.8%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
      2. sub-div99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -19000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.2 \cdot 10^{-76}:\\ \;\;\;\;\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.75 \cdot 10^{-181}:\\ \;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3300000:\\ \;\;\;\;\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 - x \cdot \cos B}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 90.3% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -5 \cdot 10^{-77}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\

\mathbf{elif}\;F \leq 7.6 \cdot 10^{-55}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}} - t\_0\\

\mathbf{elif}\;F \leq 0.00026:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

    1. Initial program 53.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified68.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 F around -inf 99.7%

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

    if -1.20000000000000003e-4 < F < -4.99999999999999963e-77

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/76.6%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity76.6%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative76.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine76.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/76.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified76.7%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around 0 75.5%

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

    if -4.99999999999999963e-77 < F < 7.5999999999999993e-55

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5999999999999993e-55 < F < 2.59999999999999977e-4

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/89.1%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity88.8%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative88.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow288.8%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine88.8%

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

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

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

    if 2.59999999999999977e-4 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      2. *-commutative98.5%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
      2. sub-div98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00012:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5 \cdot 10^{-77}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-55}:\\ \;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.00026:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 84.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -2 \cdot 10^{-81}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\

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

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

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


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

    1. Initial program 53.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified68.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 F around -inf 99.7%

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

    if -5.20000000000000019e-6 < F < -1.9999999999999999e-81

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/76.6%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity76.6%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative76.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine76.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/76.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified76.7%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around 0 75.5%

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

    if -1.9999999999999999e-81 < F < 4.9999999999999998e-179

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\frac{\sin B}{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

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

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

    if 4.9999999999999998e-179 < F < 1.50000000000000004e-5

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/62.8%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity62.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative62.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow262.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified62.7%

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

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

    if 1.50000000000000004e-5 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      2. *-commutative98.5%

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

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

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{\cos B \cdot x}{\sin B}} \]
      2. sub-div98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-81}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-179}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 84.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.3 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-82}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-179}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 2.95 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\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 -2.3e-5)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F -4.5e-82)
       (/ F (* (sin B) (sqrt 2.0)))
       (if (<= F 5e-179)
         (/ (* x (cos B)) (- (sin B)))
         (if (<= F 2.95e-6)
           (/ (* F (sqrt 0.5)) (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 <= -2.3e-5) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= -4.5e-82) {
		tmp = F / (sin(B) * sqrt(2.0));
	} else if (F <= 5e-179) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 2.95e-6) {
		tmp = (F * sqrt(0.5)) / 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 <= (-2.3d-5)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= (-4.5d-82)) then
        tmp = f / (sin(b) * sqrt(2.0d0))
    else if (f <= 5d-179) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 2.95d-6) then
        tmp = (f * sqrt(0.5d0)) / 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 <= -2.3e-5) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= -4.5e-82) {
		tmp = F / (Math.sin(B) * Math.sqrt(2.0));
	} else if (F <= 5e-179) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 2.95e-6) {
		tmp = (F * Math.sqrt(0.5)) / 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 <= -2.3e-5:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= -4.5e-82:
		tmp = F / (math.sin(B) * math.sqrt(2.0))
	elif F <= 5e-179:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 2.95e-6:
		tmp = (F * math.sqrt(0.5)) / 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 <= -2.3e-5)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= -4.5e-82)
		tmp = Float64(F / Float64(sin(B) * sqrt(2.0)));
	elseif (F <= 5e-179)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 2.95e-6)
		tmp = Float64(Float64(F * sqrt(0.5)) / 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 <= -2.3e-5)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= -4.5e-82)
		tmp = F / (sin(B) * sqrt(2.0));
	elseif (F <= 5e-179)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 2.95e-6)
		tmp = (F * sqrt(0.5)) / 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, -2.3e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -4.5e-82], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-179], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 2.95e-6], N[(N[(F * N[Sqrt[0.5], $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 -2.3 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

\mathbf{elif}\;F \leq -4.5 \cdot 10^{-82}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\

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

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

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


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

    1. Initial program 53.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified68.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 F around -inf 99.7%

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

    if -2.3e-5 < F < -4.4999999999999998e-82

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/76.6%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity76.6%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative76.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine76.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/76.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified76.7%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around 0 75.5%

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

    if -4.4999999999999998e-82 < F < 4.9999999999999998e-179

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\frac{\sin B}{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

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

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

    if 4.9999999999999998e-179 < F < 2.95000000000000013e-6

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/62.8%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity62.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative62.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow262.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified62.7%

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

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

    if 2.95000000000000013e-6 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

Alternative 12: 77.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.000116:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-70}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-179}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.049:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.000116)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F -1.6e-70)
     (/ F (* (sin B) (sqrt 2.0)))
     (if (<= F 5e-179)
       (/ (* x (cos B)) (- (sin B)))
       (if (<= F 0.049)
         (/ (* F (sqrt 0.5)) (sin B))
         (- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.000116) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= -1.6e-70) {
		tmp = F / (sin(B) * sqrt(2.0));
	} else if (F <= 5e-179) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 0.049) {
		tmp = (F * sqrt(0.5)) / 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.000116d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= (-1.6d-70)) then
        tmp = f / (sin(b) * sqrt(2.0d0))
    else if (f <= 5d-179) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 0.049d0) then
        tmp = (f * sqrt(0.5d0)) / 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.000116) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= -1.6e-70) {
		tmp = F / (Math.sin(B) * Math.sqrt(2.0));
	} else if (F <= 5e-179) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 0.049) {
		tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.000116:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= -1.6e-70:
		tmp = F / (math.sin(B) * math.sqrt(2.0))
	elif F <= 5e-179:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 0.049:
		tmp = (F * math.sqrt(0.5)) / 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.000116)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= -1.6e-70)
		tmp = Float64(F / Float64(sin(B) * sqrt(2.0)));
	elseif (F <= 5e-179)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 0.049)
		tmp = Float64(Float64(F * sqrt(0.5)) / 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.000116)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= -1.6e-70)
		tmp = F / (sin(B) * sqrt(2.0));
	elseif (F <= 5e-179)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 0.049)
		tmp = (F * sqrt(0.5)) / sin(B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.000116], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.6e-70], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-179], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.049], N[(N[(F * N[Sqrt[0.5], $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.000116:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq -1.6 \cdot 10^{-70}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\

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

\mathbf{elif}\;F \leq 0.049:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\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 < -1.16e-4

    1. Initial program 53.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified68.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 F around -inf 99.7%

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

    if -1.16e-4 < F < -1.5999999999999999e-70

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/76.6%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity76.6%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative76.6%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine76.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/76.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified76.7%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around 0 75.5%

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

    if -1.5999999999999999e-70 < F < 4.9999999999999998e-179

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\frac{\sin B}{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

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

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

    if 4.9999999999999998e-179 < F < 0.049000000000000002

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/62.8%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity62.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative62.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow262.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified62.7%

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

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

    if 0.049000000000000002 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

      \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 13: 70.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -50000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.4 \cdot 10^{-74}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-179}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.00195:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -50000000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -1.4e-74)
     (/ F (* (sin B) (sqrt 2.0)))
     (if (<= F 5e-179)
       (/ (* x (cos B)) (- (sin B)))
       (if (<= F 0.00195)
         (/ (* F (sqrt 0.5)) (sin B))
         (- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -50000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.4e-74) {
		tmp = F / (sin(B) * sqrt(2.0));
	} else if (F <= 5e-179) {
		tmp = (x * cos(B)) / -sin(B);
	} else if (F <= 0.00195) {
		tmp = (F * sqrt(0.5)) / 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 <= (-50000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.4d-74)) then
        tmp = f / (sin(b) * sqrt(2.0d0))
    else if (f <= 5d-179) then
        tmp = (x * cos(b)) / -sin(b)
    else if (f <= 0.00195d0) then
        tmp = (f * sqrt(0.5d0)) / 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 <= -50000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.4e-74) {
		tmp = F / (Math.sin(B) * Math.sqrt(2.0));
	} else if (F <= 5e-179) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if (F <= 0.00195) {
		tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -50000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.4e-74:
		tmp = F / (math.sin(B) * math.sqrt(2.0))
	elif F <= 5e-179:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif F <= 0.00195:
		tmp = (F * math.sqrt(0.5)) / math.sin(B)
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -50000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.4e-74)
		tmp = Float64(F / Float64(sin(B) * sqrt(2.0)));
	elseif (F <= 5e-179)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif (F <= 0.00195)
		tmp = Float64(Float64(F * sqrt(0.5)) / 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 <= -50000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.4e-74)
		tmp = F / (sin(B) * sqrt(2.0));
	elseif (F <= 5e-179)
		tmp = (x * cos(B)) / -sin(B);
	elseif (F <= 0.00195)
		tmp = (F * sqrt(0.5)) / sin(B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -50000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.4e-74], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-179], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.00195], N[(N[(F * N[Sqrt[0.5], $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 -50000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.4 \cdot 10^{-74}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\

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

\mathbf{elif}\;F \leq 0.00195:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\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 < -5e7

    1. Initial program 53.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. Simplified67.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 F around -inf 99.7%

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

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

    if -5e7 < F < -1.39999999999999994e-74

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num99.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/72.1%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity72.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr72.3%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/72.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified72.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around 0 71.1%

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

    if -1.39999999999999994e-74 < F < 4.9999999999999998e-179

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F}{\frac{\sin B}{\color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

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

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

    if 4.9999999999999998e-179 < F < 0.0019499999999999999

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/62.8%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity62.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative62.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow262.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified62.7%

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

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

    if 0.0019499999999999999 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

      \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 14: 70.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -50000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-83}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-179}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 0.122:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -50000000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -6.5e-83)
     (/ F (* (sin B) (sqrt 2.0)))
     (if (<= F 2.45e-179)
       (/ (- x) (tan B))
       (if (<= F 0.122)
         (/ (* F (sqrt 0.5)) (sin B))
         (- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -50000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.5e-83) {
		tmp = F / (sin(B) * sqrt(2.0));
	} else if (F <= 2.45e-179) {
		tmp = -x / tan(B);
	} else if (F <= 0.122) {
		tmp = (F * sqrt(0.5)) / 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 <= (-50000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.5d-83)) then
        tmp = f / (sin(b) * sqrt(2.0d0))
    else if (f <= 2.45d-179) then
        tmp = -x / tan(b)
    else if (f <= 0.122d0) then
        tmp = (f * sqrt(0.5d0)) / 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 <= -50000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.5e-83) {
		tmp = F / (Math.sin(B) * Math.sqrt(2.0));
	} else if (F <= 2.45e-179) {
		tmp = -x / Math.tan(B);
	} else if (F <= 0.122) {
		tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -50000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.5e-83:
		tmp = F / (math.sin(B) * math.sqrt(2.0))
	elif F <= 2.45e-179:
		tmp = -x / math.tan(B)
	elif F <= 0.122:
		tmp = (F * math.sqrt(0.5)) / math.sin(B)
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -50000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.5e-83)
		tmp = Float64(F / Float64(sin(B) * sqrt(2.0)));
	elseif (F <= 2.45e-179)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 0.122)
		tmp = Float64(Float64(F * sqrt(0.5)) / 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 <= -50000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.5e-83)
		tmp = F / (sin(B) * sqrt(2.0));
	elseif (F <= 2.45e-179)
		tmp = -x / tan(B);
	elseif (F <= 0.122)
		tmp = (F * sqrt(0.5)) / sin(B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -50000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.5e-83], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.45e-179], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.122], N[(N[(F * N[Sqrt[0.5], $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 -50000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -6.5 \cdot 10^{-83}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\

\mathbf{elif}\;F \leq 2.45 \cdot 10^{-179}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 0.122:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\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 < -5e7

    1. Initial program 53.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. Simplified67.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 F around -inf 99.7%

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

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

    if -5e7 < F < -6.5e-83

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num99.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/72.1%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity72.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr72.3%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/72.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified72.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around 0 71.1%

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

    if -6.5e-83 < F < 2.45e-179

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      3. associate-*r/80.6%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in80.6%

        \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
      5. distribute-neg-frac80.6%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\sin B}\right)} \cdot \cos B \]
      3. distribute-lft-neg-out80.6%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      4. associate-/r/80.6%

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

        \[\leadsto -\frac{x}{\color{blue}{\tan B}} \]
      6. neg-sub080.6%

        \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Applied egg-rr80.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub080.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg280.6%

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

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

    if 2.45e-179 < F < 0.122

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/62.8%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity62.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative62.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow262.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified62.7%

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

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

    if 0.122 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -50000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{-83}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-179}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 0.122:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 70.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -50000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.9 \cdot 10^{-80}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-179}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{-5}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -50000000.0)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F -1.9e-80)
     (/ F (* (sin B) (sqrt 2.0)))
     (if (<= F 2.45e-179)
       (/ (- x) (tan B))
       (if (<= F 5.3e-5)
         (* F (/ (sqrt 0.5) (sin B)))
         (- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -50000000.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -1.9e-80) {
		tmp = F / (sin(B) * sqrt(2.0));
	} else if (F <= 2.45e-179) {
		tmp = -x / tan(B);
	} else if (F <= 5.3e-5) {
		tmp = F * (sqrt(0.5) / 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 <= (-50000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-1.9d-80)) then
        tmp = f / (sin(b) * sqrt(2.0d0))
    else if (f <= 2.45d-179) then
        tmp = -x / tan(b)
    else if (f <= 5.3d-5) then
        tmp = f * (sqrt(0.5d0) / 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 <= -50000000.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -1.9e-80) {
		tmp = F / (Math.sin(B) * Math.sqrt(2.0));
	} else if (F <= 2.45e-179) {
		tmp = -x / Math.tan(B);
	} else if (F <= 5.3e-5) {
		tmp = F * (Math.sqrt(0.5) / Math.sin(B));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -50000000.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -1.9e-80:
		tmp = F / (math.sin(B) * math.sqrt(2.0))
	elif F <= 2.45e-179:
		tmp = -x / math.tan(B)
	elif F <= 5.3e-5:
		tmp = F * (math.sqrt(0.5) / math.sin(B))
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -50000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -1.9e-80)
		tmp = Float64(F / Float64(sin(B) * sqrt(2.0)));
	elseif (F <= 2.45e-179)
		tmp = Float64(Float64(-x) / tan(B));
	elseif (F <= 5.3e-5)
		tmp = Float64(F * Float64(sqrt(0.5) / 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 <= -50000000.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -1.9e-80)
		tmp = F / (sin(B) * sqrt(2.0));
	elseif (F <= 2.45e-179)
		tmp = -x / tan(B);
	elseif (F <= 5.3e-5)
		tmp = F * (sqrt(0.5) / sin(B));
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -50000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.9e-80], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.45e-179], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.3e-5], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[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}\;F \leq -50000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.9 \cdot 10^{-80}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\

\mathbf{elif}\;F \leq 2.45 \cdot 10^{-179}:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 5.3 \cdot 10^{-5}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\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 < -5e7

    1. Initial program 53.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. Simplified67.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 F around -inf 99.7%

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

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

    if -5e7 < F < -1.89999999999999983e-80

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num99.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/72.1%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity72.1%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr72.3%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/72.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified72.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around 0 71.1%

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

    if -1.89999999999999983e-80 < F < 2.45e-179

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      3. associate-*r/80.6%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in80.6%

        \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
      5. distribute-neg-frac80.6%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\sin B}\right)} \cdot \cos B \]
      3. distribute-lft-neg-out80.6%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      4. associate-/r/80.6%

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

        \[\leadsto -\frac{x}{\color{blue}{\tan B}} \]
      6. neg-sub080.6%

        \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Applied egg-rr80.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub080.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg280.6%

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

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

    if 2.45e-179 < F < 5.3000000000000001e-5

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/62.8%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity62.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative62.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow262.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified62.7%

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

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

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    11. Simplified62.2%

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

    if 5.3000000000000001e-5 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -50000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.9 \cdot 10^{-80}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\ \mathbf{elif}\;F \leq 2.45 \cdot 10^{-179}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 5.3 \cdot 10^{-5}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 70.8% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 5 \cdot 10^{-179}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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

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


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

    1. Initial program 53.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. Simplified67.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 F around -inf 99.7%

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

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

    if -5e7 < F < -9.8000000000000001e-70 or 4.9999999999999998e-179 < F < 0.0379999999999999991

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/65.7%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity65.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative65.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow265.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified65.7%

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

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

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    11. Simplified65.0%

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

    if -9.8000000000000001e-70 < F < 4.9999999999999998e-179

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      3. associate-*r/80.6%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in80.6%

        \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
      5. distribute-neg-frac80.6%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\sin B}\right)} \cdot \cos B \]
      3. distribute-lft-neg-out80.6%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      4. associate-/r/80.6%

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

        \[\leadsto -\frac{x}{\color{blue}{\tan B}} \]
      6. neg-sub080.6%

        \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Applied egg-rr80.6%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub080.6%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg280.6%

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

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

    if 0.0379999999999999991 < F

    1. Initial program 59.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. Simplified74.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 F around inf 98.5%

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

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

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

Alternative 17: 64.9% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 10.5:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 1.5 \cdot 10^{+185}:\\
\;\;\;\;\frac{1}{\sin B}\\

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


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

    1. Initial program 49.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. Simplified65.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 F around -inf 99.7%

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

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

    if -7.2000000000000001e35 < F < 10.5

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      3. associate-*r/61.3%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in61.3%

        \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
      5. distribute-neg-frac61.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    9. Step-by-step derivation
      1. *-commutative61.3%

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\sin B}\right)} \cdot \cos B \]
      3. distribute-lft-neg-out61.3%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      4. associate-/r/61.3%

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

        \[\leadsto -\frac{x}{\color{blue}{\tan B}} \]
      6. neg-sub061.3%

        \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Applied egg-rr61.3%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub061.3%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg261.3%

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

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

    if 10.5 < F < 1.49999999999999997e185

    1. Initial program 79.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. Simplified86.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. Step-by-step derivation
      1. clear-num86.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/58.3%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity58.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow258.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr58.4%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/58.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified58.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around inf 68.8%

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

    if 1.49999999999999997e185 < F

    1. Initial program 27.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. Simplified55.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 F around inf 99.4%

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

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

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

Alternative 18: 65.4% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 12.6:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\
\;\;\;\;\frac{1}{\sin B}\\

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


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

    1. Initial program 61.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. Simplified73.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 F around -inf 87.6%

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

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

    if -1.1e-69 < F < 12.5999999999999996

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      3. associate-*r/66.3%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in66.3%

        \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
      5. distribute-neg-frac66.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    9. Step-by-step derivation
      1. *-commutative66.3%

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\sin B}\right)} \cdot \cos B \]
      3. distribute-lft-neg-out66.3%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      4. associate-/r/66.3%

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

        \[\leadsto -\frac{x}{\color{blue}{\tan B}} \]
      6. neg-sub066.3%

        \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Applied egg-rr66.3%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub066.3%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg266.3%

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

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

    if 12.5999999999999996 < F < 1.39999999999999991e185

    1. Initial program 79.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. Simplified86.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. Step-by-step derivation
      1. clear-num86.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/58.3%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity58.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow258.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr58.4%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/58.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified58.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around inf 68.8%

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

    if 1.39999999999999991e185 < F

    1. Initial program 27.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. Simplified55.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 F around inf 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.1 \cdot 10^{-69}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 12.6:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{+185}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 59.1% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 12.6:\\
\;\;\;\;\frac{-x}{\tan B}\\

\mathbf{elif}\;F \leq 2 \cdot 10^{+184}:\\
\;\;\;\;\frac{1}{\sin B}\\

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


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

    1. Initial program 49.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. Simplified65.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. Step-by-step derivation
      1. clear-num65.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/22.0%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity22.0%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative22.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow222.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine22.0%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified22.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr22.0%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/22.0%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified22.0%

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

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

    if -7.2000000000000001e35 < F < 12.5999999999999996

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      3. associate-*r/61.3%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in61.3%

        \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
      5. distribute-neg-frac61.3%

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

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    9. Step-by-step derivation
      1. *-commutative61.3%

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\sin B}\right)} \cdot \cos B \]
      3. distribute-lft-neg-out61.3%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      4. associate-/r/61.3%

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

        \[\leadsto -\frac{x}{\color{blue}{\tan B}} \]
      6. neg-sub061.3%

        \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Applied egg-rr61.3%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub061.3%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg261.3%

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

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

    if 12.5999999999999996 < F < 2.00000000000000003e184

    1. Initial program 79.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. Simplified86.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. Step-by-step derivation
      1. clear-num86.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/58.3%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity58.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow258.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr58.4%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/58.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified58.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around inf 68.8%

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

    if 2.00000000000000003e184 < F

    1. Initial program 27.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. Simplified55.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 F around inf 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{+35}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 12.6:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+184}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 45.0% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 8.5:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{+176}:\\
\;\;\;\;\frac{1}{\sin B}\\

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


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

    1. Initial program 60.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. Simplified72.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. Step-by-step derivation
      1. clear-num72.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/29.8%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity29.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative29.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow229.7%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified29.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/29.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified29.8%

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

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

    if -4.5999999999999998e-49 < F < 8.5

    1. Initial program 99.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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 F around inf 31.5%

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

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    6. Taylor expanded in x around inf 34.0%

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

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

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

    if 8.5 < F < 7.499999999999999e176

    1. Initial program 79.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. Simplified86.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. Step-by-step derivation
      1. clear-num86.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/58.3%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity58.2%

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

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow258.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr58.4%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/58.2%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified58.2%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around inf 68.8%

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

    if 7.499999999999999e176 < F

    1. Initial program 27.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. Simplified55.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 F around inf 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.6 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 8.5:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{+176}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 70.8% accurate, 2.8× speedup?

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

\mathbf{elif}\;F \leq 3 \cdot 10^{-12}:\\
\;\;\;\;\frac{-x}{\tan B}\\

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


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

    1. Initial program 49.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. Simplified65.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 F around -inf 99.7%

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

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

    if -7.2000000000000001e35 < F < 3.0000000000000001e-12

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      3. associate-*r/61.9%

        \[\leadsto -\color{blue}{\cos B \cdot \frac{x}{\sin B}} \]
      4. distribute-rgt-neg-in61.9%

        \[\leadsto \color{blue}{\cos B \cdot \left(-\frac{x}{\sin B}\right)} \]
      5. distribute-neg-frac61.9%

        \[\leadsto \cos B \cdot \color{blue}{\frac{-x}{\sin B}} \]
    8. Simplified61.9%

      \[\leadsto \color{blue}{\cos B \cdot \frac{-x}{\sin B}} \]
    9. Step-by-step derivation
      1. *-commutative61.9%

        \[\leadsto \color{blue}{\frac{-x}{\sin B} \cdot \cos B} \]
      2. distribute-frac-neg61.9%

        \[\leadsto \color{blue}{\left(-\frac{x}{\sin B}\right)} \cdot \cos B \]
      3. distribute-lft-neg-out61.9%

        \[\leadsto \color{blue}{-\frac{x}{\sin B} \cdot \cos B} \]
      4. associate-/r/61.9%

        \[\leadsto -\color{blue}{\frac{x}{\frac{\sin B}{\cos B}}} \]
      5. tan-quot61.9%

        \[\leadsto -\frac{x}{\color{blue}{\tan B}} \]
      6. neg-sub061.9%

        \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    10. Applied egg-rr61.9%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub061.9%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg261.9%

        \[\leadsto \color{blue}{\frac{x}{-\tan B}} \]
    12. Simplified61.9%

      \[\leadsto \color{blue}{\frac{x}{-\tan B}} \]

    if 3.0000000000000001e-12 < F

    1. Initial program 60.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. Simplified75.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 F around inf 95.9%

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 83.2%

      \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{+35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-12}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 43.8% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.8e-49)
   (/ -1.0 (sin B))
   (if (<= F 1.15e-55) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.8e-49) {
		tmp = -1.0 / sin(B);
	} else if (F <= 1.15e-55) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-4.8d-49)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 1.15d-55) then
        tmp = x / -b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.8e-49) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 1.15e-55) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4.8e-49:
		tmp = -1.0 / math.sin(B)
	elif F <= 1.15e-55:
		tmp = x / -B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.8e-49)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 1.15e-55)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -4.8e-49)
		tmp = -1.0 / sin(B);
	elseif (F <= 1.15e-55)
		tmp = x / -B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4.8e-49], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-55], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.8 \cdot 10^{-49}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 1.15 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.79999999999999985e-49

    1. Initial program 60.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. Simplified72.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. Step-by-step derivation
      1. clear-num72.4%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
      2. un-div-inv72.5%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
      3. fma-define72.5%

        \[\leadsto \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F + 2}\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
      4. fma-undefine72.5%

        \[\leadsto \frac{F}{\frac{\sin B}{{\color{blue}{\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}}^{-0.5}}} - \frac{x}{\tan B} \]
      5. *-commutative72.5%

        \[\leadsto \frac{F}{\frac{\sin B}{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
      6. fma-define72.5%

        \[\leadsto \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{-0.5}}} - \frac{x}{\tan B} \]
      7. fma-define72.5%

        \[\leadsto \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
    5. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in x around 0 27.3%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/29.8%

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      2. *-lft-identity29.8%

        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\color{blue}{1 \cdot \sin B}} \]
      3. times-frac29.7%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity29.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative29.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow229.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine29.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified29.7%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    9. Step-by-step derivation
      1. associate-*r/29.8%

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
      2. sqrt-div29.8%

        \[\leadsto \frac{F \cdot \color{blue}{\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
      3. metadata-eval29.8%

        \[\leadsto \frac{F \cdot \frac{\color{blue}{1}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} \]
      4. un-div-inv29.8%

        \[\leadsto \frac{\color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    10. Applied egg-rr29.8%

      \[\leadsto \color{blue}{\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    11. Step-by-step derivation
      1. associate-/l/29.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    12. Simplified29.8%

      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}} \]
    13. Taylor expanded in F around -inf 46.8%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -4.79999999999999985e-49 < F < 1.15000000000000006e-55

    1. Initial program 99.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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 F around inf 31.4%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 20.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    6. Taylor expanded in x around inf 35.6%

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    7. Step-by-step derivation
      1. neg-mul-135.6%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified35.6%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]

    if 1.15000000000000006e-55 < F

    1. Initial program 64.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. Simplified77.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 F around inf 88.8%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 46.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification42.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{-49}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 43.5% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1e-81)
   (/ (- -1.0 x) B)
   (if (<= F 3e-55) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3e-55) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1d-81)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 3d-55) then
        tmp = x / -b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3e-55) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1e-81:
		tmp = (-1.0 - x) / B
	elif F <= 3e-55:
		tmp = x / -B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1e-81)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3e-55)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1e-81)
		tmp = (-1.0 - x) / B;
	elseif (F <= 3e-55)
		tmp = x / -B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1e-81], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3e-55], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{-81}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -9.9999999999999996e-82

    1. Initial program 61.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. Simplified73.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 F around -inf 87.4%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 43.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. associate-*r/43.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. neg-mul-143.8%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in43.8%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval43.8%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
      5. unsub-neg43.8%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    7. Simplified43.8%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -9.9999999999999996e-82 < F < 3.00000000000000016e-55

    1. Initial program 99.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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 F around inf 31.3%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 20.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    6. Taylor expanded in x around inf 35.5%

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    7. Step-by-step derivation
      1. neg-mul-135.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified35.5%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]

    if 3.00000000000000016e-55 < F

    1. Initial program 64.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. Simplified77.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 F around inf 88.8%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 46.6%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification41.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-55}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 31.0% accurate, 23.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{-70} \lor \neg \left(x \leq 1.1 \cdot 10^{-203}\right):\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -6e-70) (not (<= x 1.1e-203))) (/ x (- B)) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -6e-70) || !(x <= 1.1e-203)) {
		tmp = x / -B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-6d-70)) .or. (.not. (x <= 1.1d-203))) then
        tmp = x / -b
    else
        tmp = 1.0d0 / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -6e-70) || !(x <= 1.1e-203)) {
		tmp = x / -B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -6e-70) or not (x <= 1.1e-203):
		tmp = x / -B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -6e-70) || !(x <= 1.1e-203))
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -6e-70) || ~((x <= 1.1e-203)))
		tmp = x / -B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -6e-70], N[Not[LessEqual[x, 1.1e-203]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-70} \lor \neg \left(x \leq 1.1 \cdot 10^{-203}\right):\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.0000000000000003e-70 or 1.1e-203 < x

    1. Initial program 79.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Simplified90.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 F around inf 64.1%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 35.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    6. Taylor expanded in x around inf 40.9%

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    7. Step-by-step derivation
      1. neg-mul-140.9%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified40.9%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]

    if -6.0000000000000003e-70 < x < 1.1e-203

    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. Simplified70.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 F around inf 27.5%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 16.7%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    6. Taylor expanded in x around 0 16.7%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification33.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{-70} \lor \neg \left(x \leq 1.1 \cdot 10^{-203}\right):\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 36.6% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.06 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.06e-80) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.06e-80) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.06d-80)) then
        tmp = ((-1.0d0) - x) / b
    else
        tmp = x / -b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.06e-80) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.06e-80:
		tmp = (-1.0 - x) / B
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.06e-80)
		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 <= -1.06e-80)
		tmp = (-1.0 - x) / B;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.06e-80], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.06 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -1.0600000000000001e-80

    1. Initial program 61.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. Simplified73.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 F around -inf 87.4%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 43.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. associate-*r/43.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. neg-mul-143.8%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in43.8%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval43.8%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
      5. unsub-neg43.8%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    7. Simplified43.8%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -1.0600000000000001e-80 < F

    1. Initial program 83.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. Simplified89.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 F around inf 57.4%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 32.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    6. Taylor expanded in x around inf 32.0%

      \[\leadsto \frac{\color{blue}{-1 \cdot x}}{B} \]
    7. Step-by-step derivation
      1. neg-mul-132.0%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified32.0%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.06 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 17.4% accurate, 40.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.05 \cdot 10^{-183}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x) :precision binary64 (if (<= F 1.05e-183) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.05e-183) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= 1.05d-183) then
        tmp = (-1.0d0) / b
    else
        tmp = 1.0d0 / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.05e-183) {
		tmp = -1.0 / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 1.05e-183:
		tmp = -1.0 / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 1.05e-183)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= 1.05e-183)
		tmp = -1.0 / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 1.05e-183], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.05 \cdot 10^{-183}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.0500000000000001e-183

    1. Initial program 76.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.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. Step-by-step derivation
      1. clear-num83.9%

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
      2. un-div-inv84.0%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
      3. fma-define84.0%

        \[\leadsto \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F + 2}\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
      4. fma-undefine84.0%

        \[\leadsto \frac{F}{\frac{\sin B}{{\color{blue}{\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}}^{-0.5}}} - \frac{x}{\tan B} \]
      5. *-commutative84.0%

        \[\leadsto \frac{F}{\frac{\sin B}{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
      6. fma-define84.0%

        \[\leadsto \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{-0.5}}} - \frac{x}{\tan B} \]
      7. fma-define84.0%

        \[\leadsto \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
    5. Applied egg-rr84.0%

      \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    6. Taylor expanded in x around 0 25.3%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
    7. Step-by-step derivation
      1. associate-*l/26.7%

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      2. *-lft-identity26.7%

        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\color{blue}{1 \cdot \sin B}} \]
      3. times-frac26.7%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
      4. /-rgt-identity26.7%

        \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
      5. +-commutative26.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
      6. unpow226.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
      7. fma-undefine26.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
    8. Simplified26.7%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
    9. Taylor expanded in F around -inf 30.0%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{-1}{F}}}{\sin B} \]
    10. Taylor expanded in B around 0 14.3%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if 1.0500000000000001e-183 < F

    1. Initial program 73.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.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 F around inf 71.6%

      \[\leadsto F \cdot \frac{\color{blue}{\frac{1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    5. Taylor expanded in B around 0 38.0%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    6. Taylor expanded in x around 0 17.1%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 27: 10.5% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 75.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. Simplified83.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. Step-by-step derivation
    1. clear-num83.8%

      \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    2. un-div-inv83.8%

      \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
    3. fma-define83.8%

      \[\leadsto \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F + 2}\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
    4. fma-undefine83.8%

      \[\leadsto \frac{F}{\frac{\sin B}{{\color{blue}{\left(x \cdot 2 + \left(F \cdot F + 2\right)\right)}}^{-0.5}}} - \frac{x}{\tan B} \]
    5. *-commutative83.8%

      \[\leadsto \frac{F}{\frac{\sin B}{{\left(\color{blue}{2 \cdot x} + \left(F \cdot F + 2\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
    6. fma-define83.8%

      \[\leadsto \frac{F}{\frac{\sin B}{{\color{blue}{\left(\mathsf{fma}\left(2, x, F \cdot F + 2\right)\right)}}^{-0.5}}} - \frac{x}{\tan B} \]
    7. fma-define83.8%

      \[\leadsto \frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{-0.5}}} - \frac{x}{\tan B} \]
  5. Applied egg-rr83.8%

    \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}}} - \frac{x}{\tan B} \]
  6. Taylor expanded in x around 0 32.2%

    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
  7. Step-by-step derivation
    1. associate-*l/33.8%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
    2. *-lft-identity33.8%

      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\color{blue}{1 \cdot \sin B}} \]
    3. times-frac33.8%

      \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} \]
    4. /-rgt-identity33.8%

      \[\leadsto \color{blue}{F} \cdot \frac{\sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B} \]
    5. +-commutative33.8%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
    6. unpow233.8%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
    7. fma-undefine33.8%

      \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
  8. Simplified33.8%

    \[\leadsto \color{blue}{F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} \]
  9. Taylor expanded in F around -inf 18.9%

    \[\leadsto F \cdot \frac{\color{blue}{\frac{-1}{F}}}{\sin B} \]
  10. Taylor expanded in B around 0 9.8%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2024181 
(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))))))