VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.4% → 99.7%
Time: 30.4s
Alternatives: 22
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 76.4% 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.55 \cdot 10^{+80}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 160000000:\\ \;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -1.55e+80)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 160000000.0)
       (- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -1.55e+80) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 160000000.0) {
		tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1.55e+80)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 160000000.0)
		tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.55e+80], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 160000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 47.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999994e80 < F < 1.6e8

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

    if 1.6e8 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 47.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e80 < F < 1.2e8

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e8 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.9000000000000003e-21 < F < 9e7

    1. Initial program 99.5%

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

    if 9e7 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.44999999999999996

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.44999999999999996 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 1.44999999999999996

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{0.5} \cdot F}}{\sin B} - \frac{x}{\tan B} \]
    10. Simplified98.5%

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

    if 1.44999999999999996 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.7 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

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

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

\mathbf{elif}\;F \leq 13.5:\\
\;\;\;\;t\_0 \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.69999999999999998e-38 < F < -1.6000000000000001e-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. Add Preprocessing
    3. Taylor expanded in B around 0 85.2%

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

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

    if -1.6000000000000001e-181 < F < 2.34999999999999996e-110

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval86.4%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{--1}{\color{blue}{-\sin B}} \]
      5. frac-2neg86.4%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{-1}{\sin B}} \]
      6. add-sqr-sqrt43.7%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod34.1%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      9. metadata-eval34.1%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      10. metadata-eval34.1%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times34.1%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      12. rgt-mult-inverse34.0%

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

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod1.1%

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse1.9%

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

        \[\leadsto \color{blue}{\cos B \cdot \left(x \cdot \frac{1}{\sin B}\right)} \]
    10. Applied egg-rr86.7%

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

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

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

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

    if 2.34999999999999996e-110 < F < 13.5

    1. Initial program 99.7%

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

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

    if 13.5 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.7 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-181}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{-110}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{elif}\;F \leq 13.5:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 88.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.8 \cdot 10^{-38}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

\mathbf{elif}\;F \leq -4.4 \cdot 10^{-182}:\\
\;\;\;\;t\_0\\

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

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

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


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

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e-38 < F < -4.3999999999999999e-182 or 3.0000000000000001e-113 < F < 0.97999999999999998

    1. Initial program 99.5%

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

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

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

    if -4.3999999999999999e-182 < F < 3.0000000000000001e-113

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval86.4%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{--1}{\color{blue}{-\sin B}} \]
      5. frac-2neg86.4%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{-1}{\sin B}} \]
      6. add-sqr-sqrt43.7%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod34.1%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      9. metadata-eval34.1%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      10. metadata-eval34.1%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times34.1%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      12. rgt-mult-inverse34.0%

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

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod1.1%

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse1.9%

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

        \[\leadsto \color{blue}{\cos B \cdot \left(x \cdot \frac{1}{\sin B}\right)} \]
    10. Applied egg-rr86.7%

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

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

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

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

    if 0.97999999999999998 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{-38}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-182}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-113}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{elif}\;F \leq 0.98:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 92.0% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 9 \cdot 10^{-111}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0 \cdot \frac{F}{B}\\

\mathbf{elif}\;F \leq 700000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\

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


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

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.9000000000000003e-21 < F < 8.99999999999999987e-111

    1. Initial program 99.5%

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

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

    if 8.99999999999999987e-111 < F < 7e5

    1. Initial program 99.7%

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

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

    if 7e5 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 92.4% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 5.2 \cdot 10^{-107}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + t\_0 \cdot \frac{F}{B}\\

\mathbf{elif}\;F \leq 5200:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\

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


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

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -400 < F < 5.2000000000000001e-107

    1. Initial program 99.5%

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

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

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

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

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

    if 5.2000000000000001e-107 < F < 5200

    1. Initial program 99.7%

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

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

    if 5200 < F

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 84.7% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-76 < F < 2.25000000000000004e-38

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac280.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval80.6%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{--1}{\color{blue}{-\sin B}} \]
      5. frac-2neg80.6%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{-1}{\sin B}} \]
      6. add-sqr-sqrt41.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod34.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      8. frac-times34.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      9. metadata-eval34.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      10. metadata-eval34.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times34.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      12. rgt-mult-inverse34.8%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      14. rgt-mult-inverse34.8%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod1.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \]
      17. add-sqr-sqrt2.0%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse2.0%

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

        \[\leadsto \color{blue}{\cos B \cdot \left(x \cdot \frac{1}{\sin B}\right)} \]
    10. Applied egg-rr80.9%

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

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

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

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

    if 2.25000000000000004e-38 < F

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{-76}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.25 \cdot 10^{-38}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 73.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-76}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-28} \lor \neg \left(F \leq 7.6 \cdot 10^{+133}\right):\\ \;\;\;\;\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 -1.45e-76)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (or (<= F 3.5e-28) (not (<= F 7.6e+133)))
     (/ x (- (tan B)))
     (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.45e-76) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if ((F <= 3.5e-28) || !(F <= 7.6e+133)) {
		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 <= (-1.45d-76)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if ((f <= 3.5d-28) .or. (.not. (f <= 7.6d+133))) 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 <= -1.45e-76) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if ((F <= 3.5e-28) || !(F <= 7.6e+133)) {
		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 <= -1.45e-76:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif (F <= 3.5e-28) or not (F <= 7.6e+133):
		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 <= -1.45e-76)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif ((F <= 3.5e-28) || !(F <= 7.6e+133))
		tmp = Float64(x / Float64(-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 <= -1.45e-76)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif ((F <= 3.5e-28) || ~((F <= 7.6e+133)))
		tmp = x / -tan(B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-76], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3.5e-28], N[Not[LessEqual[F, 7.6e+133]], $MachinePrecision]], 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 -1.45 \cdot 10^{-76}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 3.5 \cdot 10^{-28} \lor \neg \left(F \leq 7.6 \cdot 10^{+133}\right):\\
\;\;\;\;\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 < -1.4500000000000001e-76

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4500000000000001e-76 < F < 3.5e-28 or 7.6000000000000004e133 < F

    1. Initial program 88.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 F around -inf 45.7%

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac276.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval76.3%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{--1}{\color{blue}{-\sin B}} \]
      5. frac-2neg76.3%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{-1}{\sin B}} \]
      6. add-sqr-sqrt39.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod34.3%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      8. frac-times34.2%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      9. metadata-eval34.2%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      10. metadata-eval34.2%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times34.3%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      12. rgt-mult-inverse34.2%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      14. rgt-mult-inverse34.2%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod0.9%

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse1.8%

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

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

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

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

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

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

    if 3.5e-28 < F < 7.6000000000000004e133

    1. Initial program 84.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-76}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-28} \lor \neg \left(F \leq 7.6 \cdot 10^{+133}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 67.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+172}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -11:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-28} \lor \neg \left(F \leq 7.5 \cdot 10^{+133}\right):\\ \;\;\;\;\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 -2.7e+172)
   (- (/ -1.0 B) (/ x (tan B)))
   (if (<= F -11.0)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (or (<= F 3.5e-28) (not (<= F 7.5e+133)))
       (/ x (- (tan B)))
       (- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.7e+172) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= -11.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= 3.5e-28) || !(F <= 7.5e+133)) {
		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 <= (-2.7d+172)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= (-11.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= 3.5d-28) .or. (.not. (f <= 7.5d+133))) 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 <= -2.7e+172) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= -11.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= 3.5e-28) || !(F <= 7.5e+133)) {
		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 <= -2.7e+172:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= -11.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= 3.5e-28) or not (F <= 7.5e+133):
		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 <= -2.7e+172)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= -11.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= 3.5e-28) || !(F <= 7.5e+133))
		tmp = Float64(x / Float64(-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 <= -2.7e+172)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= -11.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= 3.5e-28) || ~((F <= 7.5e+133)))
		tmp = x / -tan(B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.7e+172], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -11.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3.5e-28], N[Not[LessEqual[F, 7.5e+133]], $MachinePrecision]], 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 -2.7 \cdot 10^{+172}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

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

\mathbf{elif}\;F \leq 3.5 \cdot 10^{-28} \lor \neg \left(F \leq 7.5 \cdot 10^{+133}\right):\\
\;\;\;\;\frac{x}{-\tan B}\\

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


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

    1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{-1}{B \cdot F}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. *-commutative81.8%

        \[\leadsto F \cdot \frac{-1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    10. Simplified81.8%

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

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

    if -2.7e172 < F < -11

    1. Initial program 72.6%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} + -1 \cdot \frac{x}{B} \]
      4. mul-1-neg83.3%

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

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

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

    if -11 < F < 3.5e-28 or 7.49999999999999992e133 < F

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval74.2%

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

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod33.0%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      9. metadata-eval33.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      10. metadata-eval33.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times33.0%

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      14. rgt-mult-inverse32.9%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod0.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \]
      17. add-sqr-sqrt2.0%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse1.9%

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

        \[\leadsto \color{blue}{\cos B \cdot \left(x \cdot \frac{1}{\sin B}\right)} \]
    10. Applied egg-rr74.5%

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

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

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

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

    if 3.5e-28 < F < 7.49999999999999992e133

    1. Initial program 84.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+172}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -11:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-28} \lor \neg \left(F \leq 7.5 \cdot 10^{+133}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 64.7% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{+171}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -28:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.95 \lor \neg \left(F \leq 1.15 \cdot 10^{+133}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -7e+171)
   (- (/ -1.0 B) (/ x (tan B)))
   (if (<= F -28.0)
     (- (/ -1.0 (sin B)) (/ x B))
     (if (or (<= F 0.95) (not (<= F 1.15e+133)))
       (/ x (- (tan B)))
       (+ (* B 0.16666666666666666) (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -7e+171) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= -28.0) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= 0.95) || !(F <= 1.15e+133)) {
		tmp = x / -tan(B);
	} else {
		tmp = (B * 0.16666666666666666) + ((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 <= (-7d+171)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= (-28.0d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= 0.95d0) .or. (.not. (f <= 1.15d+133))) then
        tmp = x / -tan(b)
    else
        tmp = (b * 0.16666666666666666d0) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -7e+171) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= -28.0) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= 0.95) || !(F <= 1.15e+133)) {
		tmp = x / -Math.tan(B);
	} else {
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -7e+171:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= -28.0:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= 0.95) or not (F <= 1.15e+133):
		tmp = x / -math.tan(B)
	else:
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -7e+171)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= -28.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= 0.95) || !(F <= 1.15e+133))
		tmp = Float64(x / Float64(-tan(B)));
	else
		tmp = Float64(Float64(B * 0.16666666666666666) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -7e+171)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= -28.0)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= 0.95) || ~((F <= 1.15e+133)))
		tmp = x / -tan(B);
	else
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -7e+171], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -28.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 0.95], N[Not[LessEqual[F, 1.15e+133]], $MachinePrecision]], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(B * 0.16666666666666666), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;F \leq 0.95 \lor \neg \left(F \leq 1.15 \cdot 10^{+133}\right):\\
\;\;\;\;\frac{x}{-\tan B}\\

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


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

    1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \color{blue}{\frac{-1}{B \cdot F}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. *-commutative81.8%

        \[\leadsto F \cdot \frac{-1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    10. Simplified81.8%

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

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

    if -6.9999999999999999e171 < F < -28

    1. Initial program 72.6%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} + -1 \cdot \frac{x}{B} \]
      4. mul-1-neg83.3%

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

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

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

    if -28 < F < 0.94999999999999996 or 1.14999999999999995e133 < F

    1. Initial program 89.7%

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac271.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval71.7%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{--1}{\color{blue}{-\sin B}} \]
      5. frac-2neg71.7%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{-1}{\sin B}} \]
      6. add-sqr-sqrt35.6%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod31.6%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      8. frac-times31.6%

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times31.6%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      12. rgt-mult-inverse31.6%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      14. rgt-mult-inverse31.5%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod1.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \]
      17. add-sqr-sqrt2.0%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse2.0%

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

        \[\leadsto \color{blue}{\cos B \cdot \left(x \cdot \frac{1}{\sin B}\right)} \]
    10. Applied egg-rr71.9%

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

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

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

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

    if 0.94999999999999996 < F < 1.14999999999999995e133

    1. Initial program 80.1%

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

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

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

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

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

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

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    7. Simplified50.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{+171}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -28:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.95 \lor \neg \left(F \leq 1.15 \cdot 10^{+133}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 63.8% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq 0.95 \lor \neg \left(F \leq 4.5 \cdot 10^{+127}\right):\\
\;\;\;\;\frac{x}{-\tan B}\\

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


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

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1499999999999998e-65 < F < 0.94999999999999996 or 4.50000000000000034e127 < F

    1. Initial program 89.0%

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac273.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval72.9%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{--1}{\color{blue}{-\sin B}} \]
      5. frac-2neg72.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{-1}{\sin B}} \]
      6. add-sqr-sqrt36.9%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod32.5%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      9. metadata-eval32.5%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      10. metadata-eval32.5%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times32.5%

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

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      14. rgt-mult-inverse32.5%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod1.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \]
      17. add-sqr-sqrt2.0%

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

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse1.9%

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

        \[\leadsto \color{blue}{\cos B \cdot \left(x \cdot \frac{1}{\sin B}\right)} \]
    10. Applied egg-rr73.2%

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

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

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

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

    if 0.94999999999999996 < F < 4.50000000000000034e127

    1. Initial program 80.1%

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

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

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

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

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

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

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    7. Simplified50.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.15 \cdot 10^{-65}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.95 \lor \neg \left(F \leq 4.5 \cdot 10^{+127}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 45.4% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -1.22 \cdot 10^{+24}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 4.3 \cdot 10^{-19}:\\
\;\;\;\;\frac{-x}{\sin B}\\

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


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

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.4999999999999997e119 < F < -1.21999999999999996e24

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.21999999999999996e24 < F < 4.3e-19

    1. Initial program 98.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg75.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac275.5%

        \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
      3. *-commutative75.5%

        \[\leadsto \frac{\color{blue}{\cos B \cdot x}}{-\sin B} \]
    6. Simplified75.5%

      \[\leadsto \color{blue}{\frac{\cos B \cdot x}{-\sin B}} \]
    7. Taylor expanded in B around 0 46.5%

      \[\leadsto \frac{\color{blue}{x}}{-\sin B} \]

    if 4.3e-19 < F

    1. Initial program 68.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 37.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in F around inf 48.2%

      \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    5. Taylor expanded in B around 0 37.7%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    6. Step-by-step derivation
      1. associate--l+37.7%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative37.7%

        \[\leadsto \color{blue}{B \cdot 0.16666666666666666} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. div-sub37.7%

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    7. Simplified37.7%

      \[\leadsto \color{blue}{B \cdot 0.16666666666666666 + \frac{1 - x}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification47.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{+119}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq -1.22 \cdot 10^{+24}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{-19}:\\ \;\;\;\;\frac{-x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 58.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-97} \lor \neg \left(x \leq 10^{-231}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -3.3e-97) (not (<= x 1e-231)))
   (/ x (- (tan B)))
   (/ -1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -3.3e-97) || !(x <= 1e-231)) {
		tmp = x / -tan(B);
	} else {
		tmp = -1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-3.3d-97)) .or. (.not. (x <= 1d-231))) then
        tmp = x / -tan(b)
    else
        tmp = (-1.0d0) / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -3.3e-97) || !(x <= 1e-231)) {
		tmp = x / -Math.tan(B);
	} else {
		tmp = -1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -3.3e-97) or not (x <= 1e-231):
		tmp = x / -math.tan(B)
	else:
		tmp = -1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -3.3e-97) || !(x <= 1e-231))
		tmp = Float64(x / Float64(-tan(B)));
	else
		tmp = Float64(-1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -3.3e-97) || ~((x <= 1e-231)))
		tmp = x / -tan(B);
	else
		tmp = -1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -3.3e-97], N[Not[LessEqual[x, 1e-231]], $MachinePrecision]], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{-97} \lor \neg \left(x \leq 10^{-231}\right):\\
\;\;\;\;\frac{x}{-\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.3000000000000001e-97 or 9.9999999999999999e-232 < x

    1. Initial program 81.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 66.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in x around inf 74.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg74.4%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac274.4%

        \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
      3. *-commutative74.4%

        \[\leadsto \frac{\color{blue}{\cos B \cdot x}}{-\sin B} \]
    6. Simplified74.4%

      \[\leadsto \color{blue}{\frac{\cos B \cdot x}{-\sin B}} \]
    7. Step-by-step derivation
      1. neg-mul-174.4%

        \[\leadsto \frac{\cos B \cdot x}{\color{blue}{-1 \cdot \sin B}} \]
      2. times-frac74.5%

        \[\leadsto \color{blue}{\frac{\cos B}{-1} \cdot \frac{x}{\sin B}} \]
    8. Applied egg-rr74.5%

      \[\leadsto \color{blue}{\frac{\cos B}{-1} \cdot \frac{x}{\sin B}} \]
    9. Step-by-step derivation
      1. frac-times74.4%

        \[\leadsto \color{blue}{\frac{\cos B \cdot x}{-1 \cdot \sin B}} \]
      2. div-inv74.3%

        \[\leadsto \color{blue}{\left(\cos B \cdot x\right) \cdot \frac{1}{-1 \cdot \sin B}} \]
      3. metadata-eval74.3%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{\color{blue}{--1}}{-1 \cdot \sin B} \]
      4. neg-mul-174.3%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{--1}{\color{blue}{-\sin B}} \]
      5. frac-2neg74.3%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{-1}{\sin B}} \]
      6. add-sqr-sqrt35.8%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}\right)} \]
      7. sqrt-unprod32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      8. frac-times32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      9. metadata-eval32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      10. metadata-eval32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      11. frac-times32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      12. rgt-mult-inverse32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      13. associate-*l/32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      14. rgt-mult-inverse32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F \cdot \frac{1}{F}}}{\sin B}} \]
      15. associate-*l/32.0%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      16. sqrt-unprod0.8%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}\right)} \]
      17. add-sqr-sqrt1.5%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \]
      18. associate-*l/1.5%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      19. rgt-mult-inverse1.5%

        \[\leadsto \left(\cos B \cdot x\right) \cdot \frac{\color{blue}{1}}{\sin B} \]
      20. associate-*r*1.5%

        \[\leadsto \color{blue}{\cos B \cdot \left(x \cdot \frac{1}{\sin B}\right)} \]
    10. Applied egg-rr74.5%

      \[\leadsto \color{blue}{0 - \frac{x}{\tan B}} \]
    11. Step-by-step derivation
      1. neg-sub074.5%

        \[\leadsto \color{blue}{-\frac{x}{\tan B}} \]
      2. distribute-frac-neg74.5%

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    12. Simplified74.5%

      \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

    if -3.3000000000000001e-97 < x < 9.9999999999999999e-232

    1. Initial program 63.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in63.8%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative63.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/70.7%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*70.6%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define70.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity70.6%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg70.6%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg70.6%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified70.7%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 70.6%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-*l/70.7%

        \[\leadsto F \cdot \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}{\sin B}} - \frac{x}{\tan B} \]
      2. *-lft-identity70.7%

        \[\leadsto F \cdot \frac{\color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative70.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} - \frac{x}{\tan B} \]
      4. unpow270.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} - \frac{x}{\tan B} \]
      5. fma-undefine70.7%

        \[\leadsto F \cdot \frac{\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} - \frac{x}{\tan B} \]
    7. Simplified70.7%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around -inf 35.1%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in x around 0 35.1%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-97} \lor \neg \left(x \leq 10^{-231}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 44.9% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{+119}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq -3.1 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 0.0055:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.5e+119)
   (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x)))
   (if (<= F -3.1e-5)
     (/ -1.0 (sin B))
     (if (<= F 0.0055)
       (- (* x (* B 0.3333333333333333)) (/ x B))
       (+ (* B 0.16666666666666666) (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e+119) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= -3.1e-5) {
		tmp = -1.0 / sin(B);
	} else if (F <= 0.0055) {
		tmp = (x * (B * 0.3333333333333333)) - (x / B);
	} else {
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-5.5d+119)) then
        tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
    else if (f <= (-3.1d-5)) then
        tmp = (-1.0d0) / sin(b)
    else if (f <= 0.0055d0) then
        tmp = (x * (b * 0.3333333333333333d0)) - (x / b)
    else
        tmp = (b * 0.16666666666666666d0) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.5e+119) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= -3.1e-5) {
		tmp = -1.0 / Math.sin(B);
	} else if (F <= 0.0055) {
		tmp = (x * (B * 0.3333333333333333)) - (x / B);
	} else {
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.5e+119:
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x))
	elif F <= -3.1e-5:
		tmp = -1.0 / math.sin(B)
	elif F <= 0.0055:
		tmp = (x * (B * 0.3333333333333333)) - (x / B)
	else:
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.5e+119)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x)));
	elseif (F <= -3.1e-5)
		tmp = Float64(-1.0 / sin(B));
	elseif (F <= 0.0055)
		tmp = Float64(Float64(x * Float64(B * 0.3333333333333333)) - Float64(x / B));
	else
		tmp = Float64(Float64(B * 0.16666666666666666) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.5e+119)
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	elseif (F <= -3.1e-5)
		tmp = -1.0 / sin(B);
	elseif (F <= 0.0055)
		tmp = (x * (B * 0.3333333333333333)) - (x / B);
	else
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.5e+119], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.1e-5], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0055], N[(N[(x * N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(B * 0.16666666666666666), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{+119}:\\
\;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\

\mathbf{elif}\;F \leq -3.1 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 0.0055:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -5.5000000000000003e119

    1. Initial program 41.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in41.3%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative41.3%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/63.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*63.5%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define63.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity63.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg63.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg63.5%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified63.6%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf 99.6%

      \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*99.7%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{-1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified99.7%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{-1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 81.6%

      \[\leadsto F \cdot \color{blue}{\frac{-1}{B \cdot F}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. *-commutative81.6%

        \[\leadsto F \cdot \frac{-1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    10. Simplified81.6%

      \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 51.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]

    if -5.5000000000000003e119 < F < -3.10000000000000014e-5

    1. Initial program 87.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in87.9%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative87.9%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/99.5%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*99.5%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg99.5%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. 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}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 99.3%

      \[\leadsto F \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}\right)} - \frac{x}{\tan B} \]
    6. 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} \]
    7. Simplified99.5%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around -inf 99.7%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    9. Taylor expanded in x around 0 68.2%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -3.10000000000000014e-5 < F < 0.0054999999999999997

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 38.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in x around inf 73.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg73.9%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. distribute-neg-frac273.9%

        \[\leadsto \color{blue}{\frac{x \cdot \cos B}{-\sin B}} \]
      3. *-commutative73.9%

        \[\leadsto \frac{\color{blue}{\cos B \cdot x}}{-\sin B} \]
    6. Simplified73.9%

      \[\leadsto \color{blue}{\frac{\cos B \cdot x}{-\sin B}} \]
    7. Step-by-step derivation
      1. distribute-frac-neg273.9%

        \[\leadsto \color{blue}{-\frac{\cos B \cdot x}{\sin B}} \]
      2. neg-sub073.9%

        \[\leadsto \color{blue}{0 - \frac{\cos B \cdot x}{\sin B}} \]
      3. clear-num73.7%

        \[\leadsto 0 - \color{blue}{\frac{1}{\frac{\sin B}{\cos B \cdot x}}} \]
      4. add-sqr-sqrt35.7%

        \[\leadsto 0 - \frac{1}{\frac{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}}{\cos B \cdot x}} \]
      5. sqrt-unprod30.4%

        \[\leadsto 0 - \frac{1}{\frac{\color{blue}{\sqrt{\sin B \cdot \sin B}}}{\cos B \cdot x}} \]
      6. sqr-neg30.4%

        \[\leadsto 0 - \frac{1}{\frac{\sqrt{\color{blue}{\left(-\sin B\right) \cdot \left(-\sin B\right)}}}{\cos B \cdot x}} \]
      7. sqrt-unprod1.0%

        \[\leadsto 0 - \frac{1}{\frac{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}}{\cos B \cdot x}} \]
      8. add-sqr-sqrt2.1%

        \[\leadsto 0 - \frac{1}{\frac{\color{blue}{-\sin B}}{\cos B \cdot x}} \]
      9. frac-2neg2.1%

        \[\leadsto 0 - \color{blue}{\frac{-1}{-\frac{-\sin B}{\cos B \cdot x}}} \]
      10. metadata-eval2.1%

        \[\leadsto 0 - \frac{\color{blue}{-1}}{-\frac{-\sin B}{\cos B \cdot x}} \]
      11. add-sqr-sqrt1.0%

        \[\leadsto 0 - \frac{-1}{-\frac{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}}{\cos B \cdot x}} \]
      12. sqrt-unprod30.4%

        \[\leadsto 0 - \frac{-1}{-\frac{\color{blue}{\sqrt{\left(-\sin B\right) \cdot \left(-\sin B\right)}}}{\cos B \cdot x}} \]
      13. sqr-neg30.4%

        \[\leadsto 0 - \frac{-1}{-\frac{\sqrt{\color{blue}{\sin B \cdot \sin B}}}{\cos B \cdot x}} \]
      14. sqrt-unprod35.7%

        \[\leadsto 0 - \frac{-1}{-\frac{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}}{\cos B \cdot x}} \]
      15. add-sqr-sqrt73.7%

        \[\leadsto 0 - \frac{-1}{-\frac{\color{blue}{\sin B}}{\cos B \cdot x}} \]
      16. distribute-frac-neg73.7%

        \[\leadsto 0 - \frac{-1}{\color{blue}{\frac{-\sin B}{\cos B \cdot x}}} \]
      17. neg-mul-173.7%

        \[\leadsto 0 - \frac{-1}{\frac{\color{blue}{-1 \cdot \sin B}}{\cos B \cdot x}} \]
      18. *-commutative73.7%

        \[\leadsto 0 - \frac{-1}{\frac{-1 \cdot \sin B}{\color{blue}{x \cdot \cos B}}} \]
      19. times-frac73.6%

        \[\leadsto 0 - \frac{-1}{\color{blue}{\frac{-1}{x} \cdot \frac{\sin B}{\cos B}}} \]
    8. Applied egg-rr73.7%

      \[\leadsto \color{blue}{0 - \frac{-1}{\frac{-1}{x} \cdot \tan B}} \]
    9. Step-by-step derivation
      1. neg-sub073.7%

        \[\leadsto \color{blue}{-\frac{-1}{\frac{-1}{x} \cdot \tan B}} \]
      2. distribute-neg-frac73.7%

        \[\leadsto \color{blue}{\frac{--1}{\frac{-1}{x} \cdot \tan B}} \]
      3. metadata-eval73.7%

        \[\leadsto \frac{\color{blue}{1}}{\frac{-1}{x} \cdot \tan B} \]
      4. associate-*l/73.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{-1 \cdot \tan B}{x}}} \]
      5. neg-mul-173.8%

        \[\leadsto \frac{1}{\frac{\color{blue}{-\tan B}}{x}} \]
    10. Simplified73.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{-\tan B}{x}}} \]
    11. Taylor expanded in B around 0 43.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]
    12. Step-by-step derivation
      1. +-commutative43.6%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) + -1 \cdot \frac{x}{B}} \]
      2. mul-1-neg43.6%

        \[\leadsto 0.3333333333333333 \cdot \left(B \cdot x\right) + \color{blue}{\left(-\frac{x}{B}\right)} \]
      3. unsub-neg43.6%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{x}{B}} \]
      4. *-commutative43.6%

        \[\leadsto \color{blue}{\left(B \cdot x\right) \cdot 0.3333333333333333} - \frac{x}{B} \]
      5. *-commutative43.6%

        \[\leadsto \color{blue}{\left(x \cdot B\right)} \cdot 0.3333333333333333 - \frac{x}{B} \]
      6. associate-*l*43.6%

        \[\leadsto \color{blue}{x \cdot \left(B \cdot 0.3333333333333333\right)} - \frac{x}{B} \]
    13. Simplified43.6%

      \[\leadsto \color{blue}{x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}} \]

    if 0.0054999999999999997 < F

    1. Initial program 67.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 34.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in F around inf 50.0%

      \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    5. Taylor expanded in B around 0 39.4%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    6. Step-by-step derivation
      1. associate--l+39.4%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative39.4%

        \[\leadsto \color{blue}{B \cdot 0.16666666666666666} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. div-sub39.4%

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    7. Simplified39.4%

      \[\leadsto \color{blue}{B \cdot 0.16666666666666666 + \frac{1 - x}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification46.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5 \cdot 10^{+119}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq -3.1 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 0.0055:\\ \;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 43.9% accurate, 17.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.9 \cdot 10^{-18}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.8e-78)
   (/ (- -1.0 x) B)
   (if (<= F 5.9e-18)
     (/ x (- B))
     (+ (* B 0.16666666666666666) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.8e-78) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 5.9e-18) {
		tmp = x / -B;
	} else {
		tmp = (B * 0.16666666666666666) + ((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.8d-78)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 5.9d-18) then
        tmp = x / -b
    else
        tmp = (b * 0.16666666666666666d0) + ((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.8e-78) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 5.9e-18) {
		tmp = x / -B;
	} else {
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.8e-78:
		tmp = (-1.0 - x) / B
	elif F <= 5.9e-18:
		tmp = x / -B
	else:
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.8e-78)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 5.9e-18)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(B * 0.16666666666666666) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.8e-78)
		tmp = (-1.0 - x) / B;
	elseif (F <= 5.9e-18)
		tmp = x / -B;
	else
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.8e-78], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.9e-18], N[(x / (-B)), $MachinePrecision], N[(N[(B * 0.16666666666666666), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 5.9 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.8000000000000001e-78

    1. Initial program 60.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 30.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in B around 0 37.1%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    5. Taylor expanded in F around -inf 44.5%

      \[\leadsto \frac{\color{blue}{-1} - x}{B} \]

    if -1.8000000000000001e-78 < F < 5.90000000000000019e-18

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 68.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in x around inf 48.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate-*r/48.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-148.7%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    6. Simplified48.7%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 5.90000000000000019e-18 < F

    1. Initial program 68.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 37.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in F around inf 48.2%

      \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    5. Taylor expanded in B around 0 37.7%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    6. Step-by-step derivation
      1. associate--l+37.7%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative37.7%

        \[\leadsto \color{blue}{B \cdot 0.16666666666666666} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. div-sub37.7%

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    7. Simplified37.7%

      \[\leadsto \color{blue}{B \cdot 0.16666666666666666 + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.8 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.9 \cdot 10^{-18}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 44.0% accurate, 17.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{-77}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.6e-77)
   (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x)))
   (if (<= F 2.3e-20)
     (/ x (- B))
     (+ (* B 0.16666666666666666) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.6e-77) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 2.3e-20) {
		tmp = x / -B;
	} else {
		tmp = (B * 0.16666666666666666) + ((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 <= (-2.6d-77)) then
        tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
    else if (f <= 2.3d-20) then
        tmp = x / -b
    else
        tmp = (b * 0.16666666666666666d0) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.6e-77) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 2.3e-20) {
		tmp = x / -B;
	} else {
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.6e-77:
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x))
	elif F <= 2.3e-20:
		tmp = x / -B
	else:
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.6e-77)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x)));
	elseif (F <= 2.3e-20)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(B * 0.16666666666666666) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -2.6e-77)
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	elseif (F <= 2.3e-20)
		tmp = x / -B;
	else
		tmp = (B * 0.16666666666666666) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.6e-77], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-20], N[(x / (-B)), $MachinePrecision], N[(N[(B * 0.16666666666666666), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.6000000000000001e-77

    1. Initial program 60.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in60.1%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative60.1%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. associate-*l/76.9%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      4. associate-/l*76.9%

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x\right) \cdot \frac{1}{\tan B} \]
      5. fma-define76.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      6. /-rgt-identity76.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{F}{1}}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. remove-double-neg76.9%

        \[\leadsto \mathsf{fma}\left(\frac{F}{1}, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, \color{blue}{-\left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)}\right) \]
      8. fma-neg76.9%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \left(-\left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
    3. Simplified77.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    4. Add Preprocessing
    5. Taylor expanded in F around -inf 93.5%

      \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    6. Step-by-step derivation
      1. associate-/r*93.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{-1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Simplified93.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{-1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    8. Taylor expanded in B around 0 73.8%

      \[\leadsto F \cdot \color{blue}{\frac{-1}{B \cdot F}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. *-commutative73.8%

        \[\leadsto F \cdot \frac{-1}{\color{blue}{F \cdot B}} - \frac{x}{\tan B} \]
    10. Simplified73.8%

      \[\leadsto F \cdot \color{blue}{\frac{-1}{F \cdot B}} - \frac{x}{\tan B} \]
    11. Taylor expanded in B around 0 45.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)} \]

    if -2.6000000000000001e-77 < F < 2.2999999999999999e-20

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 68.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in x around inf 48.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate-*r/48.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-148.3%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    6. Simplified48.3%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.2999999999999999e-20 < F

    1. Initial program 68.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 37.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in F around inf 48.2%

      \[\leadsto \left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    5. Taylor expanded in B around 0 37.7%

      \[\leadsto \color{blue}{\left(0.16666666666666666 \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    6. Step-by-step derivation
      1. associate--l+37.7%

        \[\leadsto \color{blue}{0.16666666666666666 \cdot B + \left(\frac{1}{B} - \frac{x}{B}\right)} \]
      2. *-commutative37.7%

        \[\leadsto \color{blue}{B \cdot 0.16666666666666666} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. div-sub37.7%

        \[\leadsto B \cdot 0.16666666666666666 + \color{blue}{\frac{1 - x}{B}} \]
    7. Simplified37.7%

      \[\leadsto \color{blue}{B \cdot 0.16666666666666666 + \frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{-77}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot 0.16666666666666666 + \frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 43.9% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.25e-81)
   (/ (- -1.0 x) B)
   (if (<= F 3.6e-27) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.25e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.6e-27) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.25d-81)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 3.6d-27) then
        tmp = x / -b
    else
        tmp = (1.0d0 - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.25e-81) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.6e-27) {
		tmp = x / -B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.25e-81:
		tmp = (-1.0 - x) / B
	elif F <= 3.6e-27:
		tmp = x / -B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.25e-81)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3.6e-27)
		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 <= -1.25e-81)
		tmp = (-1.0 - x) / B;
	elseif (F <= 3.6e-27)
		tmp = x / -B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-81], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e-27], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-81}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3.6 \cdot 10^{-27}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.24999999999999995e-81

    1. Initial program 60.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 30.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in B around 0 37.1%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    5. Taylor expanded in F around -inf 44.5%

      \[\leadsto \frac{\color{blue}{-1} - x}{B} \]

    if -1.24999999999999995e-81 < F < 3.5999999999999999e-27

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 68.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in x around inf 49.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate-*r/49.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-149.7%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    6. Simplified49.7%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 3.5999999999999999e-27 < F

    1. Initial program 69.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 39.5%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in B around 0 29.8%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    5. Taylor expanded in F around inf 36.1%

      \[\leadsto \frac{\color{blue}{1} - x}{B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 36.5% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.15 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.15e-78) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.15e-78) {
		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 <= (-2.15d-78)) 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 <= -2.15e-78) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.15e-78:
		tmp = (-1.0 - x) / B
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.15e-78)
		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 <= -2.15e-78)
		tmp = (-1.0 - x) / B;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.15e-78], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.15 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -2.14999999999999997e-78

    1. Initial program 60.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 30.3%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in B around 0 37.1%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
    5. Taylor expanded in F around -inf 44.5%

      \[\leadsto \frac{\color{blue}{-1} - x}{B} \]

    if -2.14999999999999997e-78 < F

    1. Initial program 87.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in B around 0 56.7%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Taylor expanded in x around inf 36.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    5. Step-by-step derivation
      1. associate-*r/36.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-136.1%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    6. Simplified36.1%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.15 \cdot 10^{-78}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 29.1% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{x}{-B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ x (- B)))
double code(double F, double B, double x) {
	return x / -B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = x / -b
end function
public static double code(double F, double B, double x) {
	return x / -B;
}
def code(F, B, x):
	return x / -B
function code(F, B, x)
	return Float64(x / Float64(-B))
end
function tmp = code(F, B, x)
	tmp = x / -B;
end
code[F_, B_, x_] := N[(x / (-B)), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{-B}
\end{array}
Derivation
  1. Initial program 77.8%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in B around 0 47.2%

    \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  4. Taylor expanded in x around inf 31.5%

    \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
  5. Step-by-step derivation
    1. associate-*r/31.5%

      \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
    2. neg-mul-131.5%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  6. Simplified31.5%

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  7. Final simplification31.5%

    \[\leadsto \frac{x}{-B} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024043 
(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))))))