VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.9% → 99.6%
Time: 22.5s
Alternatives: 22
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 77.9% 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.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 41.1%

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

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

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

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

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

    if -1.35000000000000003e154 < F < 1e7

    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. Simplified99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e7 < F

    1. Initial program 58.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. 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} \]
    5. 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} \]
    6. Simplified76.0%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in 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 -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 10000000:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 116000000:\\
\;\;\;\;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}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1e10

    1. Initial program 66.4%

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

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

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

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

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

    if -1e10 < F < 1.16e8

    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 1.16e8 < F

    1. Initial program 58.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
    3. Add Preprocessing
    4. 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} \]
    5. 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} \]
    6. Simplified76.0%

      \[\leadsto F \cdot \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in 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 -10000000000:\\ \;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 116000000:\\ \;\;\;\;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 3: 99.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\
\;\;\;\;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.44999999999999996

    1. Initial program 67.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 99.2%

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

    if -1.44999999999999996 < F < 8.1999999999999994e-6

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

    if 8.1999999999999994e-6 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;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 4: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.45:\\ \;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - 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.45)
     (+ (/ -1.0 (sin B)) (* x (/ -1.0 (tan B))))
     (if (<= F 8.2e-6)
       (- (/ F (/ (sin B) (sqrt 0.5))) 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.45) {
		tmp = (-1.0 / sin(B)) + (x * (-1.0 / tan(B)));
	} else if (F <= 8.2e-6) {
		tmp = (F / (sin(B) / sqrt(0.5))) - 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.45d0)) then
        tmp = ((-1.0d0) / sin(b)) + (x * ((-1.0d0) / tan(b)))
    else if (f <= 8.2d-6) then
        tmp = (f / (sin(b) / sqrt(0.5d0))) - 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.45) {
		tmp = (-1.0 / Math.sin(B)) + (x * (-1.0 / Math.tan(B)));
	} else if (F <= 8.2e-6) {
		tmp = (F / (Math.sin(B) / Math.sqrt(0.5))) - 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.45:
		tmp = (-1.0 / math.sin(B)) + (x * (-1.0 / math.tan(B)))
	elif F <= 8.2e-6:
		tmp = (F / (math.sin(B) / math.sqrt(0.5))) - 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.45)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(x * Float64(-1.0 / tan(B))));
	elseif (F <= 8.2e-6)
		tmp = Float64(Float64(F / Float64(sin(B) / sqrt(0.5))) - 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.45)
		tmp = (-1.0 / sin(B)) + (x * (-1.0 / tan(B)));
	elseif (F <= 8.2e-6)
		tmp = (F / (sin(B) / sqrt(0.5))) - 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.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.2e-6], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $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.45:\\
\;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - 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.44999999999999996

    1. Initial program 67.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 99.2%

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

    if -1.44999999999999996 < F < 8.1999999999999994e-6

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto F \cdot \color{blue}{\frac{1}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
      2. un-div-inv99.0%

        \[\leadsto \color{blue}{\frac{F}{\frac{\sin B}{\sqrt{0.5}}}} - \frac{x}{\tan B} \]
    9. Applied egg-rr99.0%

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

    if 8.1999999999999994e-6 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t\_0\\

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


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

    1. Initial program 67.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 99.2%

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

    if -1.5 < F < 8.1999999999999994e-6

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.1999999999999994e-6 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t\_0\\

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


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

    1. Initial program 67.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 99.2%

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

      \[\leadsto \left(-\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. associate-/l*99.2%

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

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

    if -1.44999999999999996 < F < 8.1999999999999994e-6

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.1999999999999994e-6 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 91.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -3 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;\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} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -3e-15)
     (+ (/ -1.0 (sin B)) (* x (/ -1.0 (tan B))))
     (if (<= F 1.35e-66)
       (- (* F (/ (sqrt 0.5) B)) t_0)
       (if (<= F 8.2e-6)
         (- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x 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 <= -3e-15) {
		tmp = (-1.0 / sin(B)) + (x * (-1.0 / tan(B)));
	} else if (F <= 1.35e-66) {
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	} else if (F <= 8.2e-6) {
		tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / 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 <= (-3d-15)) then
        tmp = ((-1.0d0) / sin(b)) + (x * ((-1.0d0) / tan(b)))
    else if (f <= 1.35d-66) then
        tmp = (f * (sqrt(0.5d0) / b)) - t_0
    else if (f <= 8.2d-6) then
        tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / 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 <= -3e-15) {
		tmp = (-1.0 / Math.sin(B)) + (x * (-1.0 / Math.tan(B)));
	} else if (F <= 1.35e-66) {
		tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
	} else if (F <= 8.2e-6) {
		tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / 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 <= -3e-15:
		tmp = (-1.0 / math.sin(B)) + (x * (-1.0 / math.tan(B)))
	elif F <= 1.35e-66:
		tmp = (F * (math.sqrt(0.5) / B)) - t_0
	elif F <= 8.2e-6:
		tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / 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 <= -3e-15)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(x * Float64(-1.0 / tan(B))));
	elseif (F <= 1.35e-66)
		tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0);
	elseif (F <= 8.2e-6)
		tmp = Float64(Float64(Float64(F / sin(B)) * (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_0);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = x / tan(B);
	tmp = 0.0;
	if (F <= -3e-15)
		tmp = (-1.0 / sin(B)) + (x * (-1.0 / tan(B)));
	elseif (F <= 1.35e-66)
		tmp = (F * (sqrt(0.5) / B)) - t_0;
	elseif (F <= 8.2e-6)
		tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / 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, -3e-15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e-66], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 8.2e-6], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], 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 -3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\

\mathbf{elif}\;F \leq 1.35 \cdot 10^{-66}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\
\;\;\;\;\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} - t\_0\\


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

    1. Initial program 68.1%

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

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

    if -3e-15 < F < 1.34999999999999998e-66

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.34999999999999998e-66 < F < 8.1999999999999994e-6

    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 89.6%

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

    if 8.1999999999999994e-6 < F

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

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

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

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

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

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

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

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

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

      \[\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 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 91.8% 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 -30000000:\\ \;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-68}:\\ \;\;\;\;t\_0 \cdot \frac{F}{B} - t\_1\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;\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 -30000000.0)
     (+ (/ -1.0 (sin B)) (* x (/ -1.0 (tan B))))
     (if (<= F 7.5e-68)
       (- (* t_0 (/ F B)) t_1)
       (if (<= F 8.2e-6)
         (- (* (/ 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 <= -30000000.0) {
		tmp = (-1.0 / sin(B)) + (x * (-1.0 / tan(B)));
	} else if (F <= 7.5e-68) {
		tmp = (t_0 * (F / B)) - t_1;
	} else if (F <= 8.2e-6) {
		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 <= (-30000000.0d0)) then
        tmp = ((-1.0d0) / sin(b)) + (x * ((-1.0d0) / tan(b)))
    else if (f <= 7.5d-68) then
        tmp = (t_0 * (f / b)) - t_1
    else if (f <= 8.2d-6) 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 <= -30000000.0) {
		tmp = (-1.0 / Math.sin(B)) + (x * (-1.0 / Math.tan(B)));
	} else if (F <= 7.5e-68) {
		tmp = (t_0 * (F / B)) - t_1;
	} else if (F <= 8.2e-6) {
		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 <= -30000000.0:
		tmp = (-1.0 / math.sin(B)) + (x * (-1.0 / math.tan(B)))
	elif F <= 7.5e-68:
		tmp = (t_0 * (F / B)) - t_1
	elif F <= 8.2e-6:
		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 <= -30000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(x * Float64(-1.0 / tan(B))));
	elseif (F <= 7.5e-68)
		tmp = Float64(Float64(t_0 * Float64(F / B)) - t_1);
	elseif (F <= 8.2e-6)
		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 <= -30000000.0)
		tmp = (-1.0 / sin(B)) + (x * (-1.0 / tan(B)));
	elseif (F <= 7.5e-68)
		tmp = (t_0 * (F / B)) - t_1;
	elseif (F <= 8.2e-6)
		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, -30000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-68], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 8.2e-6], 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 -30000000:\\
\;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\

\mathbf{elif}\;F \leq 7.5 \cdot 10^{-68}:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - t\_1\\

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\
\;\;\;\;\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 < -3e7

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

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

    if -3e7 < F < 7.50000000000000081e-68

    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.6%

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

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

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

      \[\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)} \]
    6. Step-by-step derivation
      1. *-un-lft-identity83.4%

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

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

      \[\leadsto \left(-\color{blue}{1 \cdot \frac{x}{\tan B}}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    8. Step-by-step derivation
      1. *-lft-identity83.5%

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

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

    if 7.50000000000000081e-68 < F < 8.1999999999999994e-6

    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 89.6%

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

    if 8.1999999999999994e-6 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -30000000:\\ \;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;F \leq 7.5 \cdot 10^{-68}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;\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: 78.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -3.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{-1}{B} - t\_0\\ \mathbf{elif}\;F \leq -0.054:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.3 \cdot 10^{-27}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-67}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{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 -3.2e+144)
     (- (/ -1.0 B) t_0)
     (if (<= F -0.054)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -6.3e-27)
         (/ (* F (sqrt 0.5)) (sin B))
         (if (<= F 5.4e-67)
           (/ (* (cos B) (- x)) (sin B))
           (if (<= F 7.6e-6)
             (* (/ F (sin B)) (sqrt 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 <= -3.2e+144) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.054) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.3e-27) {
		tmp = (F * sqrt(0.5)) / sin(B);
	} else if (F <= 5.4e-67) {
		tmp = (cos(B) * -x) / sin(B);
	} else if (F <= 7.6e-6) {
		tmp = (F / sin(B)) * sqrt(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 <= (-3.2d+144)) then
        tmp = ((-1.0d0) / b) - t_0
    else if (f <= (-0.054d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.3d-27)) then
        tmp = (f * sqrt(0.5d0)) / sin(b)
    else if (f <= 5.4d-67) then
        tmp = (cos(b) * -x) / sin(b)
    else if (f <= 7.6d-6) then
        tmp = (f / sin(b)) * sqrt(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 <= -3.2e+144) {
		tmp = (-1.0 / B) - t_0;
	} else if (F <= -0.054) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.3e-27) {
		tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
	} else if (F <= 5.4e-67) {
		tmp = (Math.cos(B) * -x) / Math.sin(B);
	} else if (F <= 7.6e-6) {
		tmp = (F / Math.sin(B)) * Math.sqrt(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 <= -3.2e+144:
		tmp = (-1.0 / B) - t_0
	elif F <= -0.054:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.3e-27:
		tmp = (F * math.sqrt(0.5)) / math.sin(B)
	elif F <= 5.4e-67:
		tmp = (math.cos(B) * -x) / math.sin(B)
	elif F <= 7.6e-6:
		tmp = (F / math.sin(B)) * math.sqrt(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 <= -3.2e+144)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	elseif (F <= -0.054)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.3e-27)
		tmp = Float64(Float64(F * sqrt(0.5)) / sin(B));
	elseif (F <= 5.4e-67)
		tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B));
	elseif (F <= 7.6e-6)
		tmp = Float64(Float64(F / sin(B)) * sqrt(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 <= -3.2e+144)
		tmp = (-1.0 / B) - t_0;
	elseif (F <= -0.054)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.3e-27)
		tmp = (F * sqrt(0.5)) / sin(B);
	elseif (F <= 5.4e-67)
		tmp = (cos(B) * -x) / sin(B);
	elseif (F <= 7.6e-6)
		tmp = (F / sin(B)) * sqrt(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, -3.2e+144], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -0.054], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.3e-27], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e-67], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.6e-6], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $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 -3.2 \cdot 10^{+144}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\

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

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

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

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

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


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

    1. Initial program 44.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e144 < F < -0.0539999999999999994

    1. Initial program 94.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 98.5%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+87.6%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+87.6%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub087.6%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg87.6%

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

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

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

    if -0.0539999999999999994 < F < -6.3000000000000001e-27

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 76.1%

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

    if -6.3000000000000001e-27 < F < 5.40000000000000032e-67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.40000000000000032e-67 < F < 7.6000000000000001e-6

    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. Simplified98.9%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 83.8%

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

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

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

    if 7.6000000000000001e-6 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.054:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.3 \cdot 10^{-27}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 5.4 \cdot 10^{-67}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 7.6 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.8% accurate, 1.4× speedup?

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

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

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

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

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

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

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


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

    1. Initial program 44.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

    if -3.6000000000000001e142 < F < -0.38

    1. Initial program 94.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 98.5%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+87.6%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+87.6%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub087.6%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg87.6%

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

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

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

    if -0.38 < F < -6.0999999999999999e-27

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 76.1%

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

    if -6.0999999999999999e-27 < F < 1.99999999999999989e-67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999989e-67 < F < 7.4000000000000003e-6

    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. Simplified98.9%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 83.8%

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

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

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

    if 7.4000000000000003e-6 < F

    1. Initial program 59.9%

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

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

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

      \[\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 47.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.6 \cdot 10^{+142}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.38:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.1 \cdot 10^{-27}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-67}:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 7.4 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 71.7% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -8.2 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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

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

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


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

    1. Initial program 44.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

    if -1.3500000000000001e143 < F < -8.1999999999999998e-7

    1. Initial program 94.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 98.5%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+87.6%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+87.6%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub087.6%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg87.6%

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

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

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

    if -8.1999999999999998e-7 < F < -6.0999999999999999e-27

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 76.1%

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

    if -6.0999999999999999e-27 < F < 4.50000000000000015e-67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.50000000000000015e-67 < F < 8.1999999999999994e-6

    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. Simplified98.9%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 83.8%

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

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

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

    if 8.1999999999999994e-6 < F

    1. Initial program 59.9%

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

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

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

      \[\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 47.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{+143}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.2 \cdot 10^{-7}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.1 \cdot 10^{-27}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-67}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 83.5% accurate, 1.4× speedup?

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 3 \cdot 10^{-66}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

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

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


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

    1. Initial program 44.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

    if -6.0000000000000001e143 < F < -3e-15

    1. Initial program 94.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 96.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+85.5%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+85.5%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub085.5%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg85.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      8. metadata-eval85.5%

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

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

    if -3e-15 < F < 3.0000000000000002e-66

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 3.0000000000000002e-66 < F < 8.1999999999999994e-6

    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. Simplified98.9%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 83.8%

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

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

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

    if 8.1999999999999994e-6 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{+143}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 90.4% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 1.9 \cdot 10^{-67}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\

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

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


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

    1. Initial program 68.1%

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

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

    if -3e-15 < F < 1.89999999999999994e-67

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.89999999999999994e-67 < F < 7.99999999999999964e-6

    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. Simplified98.9%

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 83.8%

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

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

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

    if 7.99999999999999964e-6 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B} + x \cdot \frac{-1}{\tan B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-67}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-6}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 59.5% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x \leq -2.2 \cdot 10^{-276}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.14999999999999995e-83 or 1.84999999999999997e-83 < x

    1. Initial program 82.0%

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

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

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

      \[\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 79.0%

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

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

    if -1.14999999999999995e-83 < x < -2.19999999999999981e-276

    1. Initial program 58.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} - \frac{1}{\sin B} \]
      2. neg-sub047.7%

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+47.7%

        \[\leadsto \color{blue}{0 - \left(\frac{x}{B} + \frac{1}{\sin B}\right)} \]
      4. +-commutative47.7%

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+47.7%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub047.7%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg47.7%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      8. metadata-eval47.7%

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

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

    if -2.19999999999999981e-276 < x < 1.84999999999999997e-83

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\color{blue}{\sqrt{0.5}}}{\sin B} - \frac{x}{\tan B} \]
    8. Taylor expanded in F around inf 46.7%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{0.5}} \]
    10. Simplified46.8%

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-83}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{B}\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-276}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{-83}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 59.9% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;x \leq -1.8 \cdot 10^{-276}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.1999999999999999e-79 or 1.28e-76 < x

    1. Initial program 81.4%

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

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

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

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

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

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

    if -6.1999999999999999e-79 < x < -1.79999999999999997e-276

    1. Initial program 58.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} - \frac{1}{\sin B} \]
      2. neg-sub047.7%

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+47.7%

        \[\leadsto \color{blue}{0 - \left(\frac{x}{B} + \frac{1}{\sin B}\right)} \]
      4. +-commutative47.7%

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+47.7%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub047.7%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg47.7%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      8. metadata-eval47.7%

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

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

    if -1.79999999999999997e-276 < x < 1.28e-76

    1. Initial program 85.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. Step-by-step derivation
      1. div-inv85.1%

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

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

      \[\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 50.9%

      \[\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)} \]
    6. Taylor expanded in B around 0 41.6%

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

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

Alternative 16: 62.6% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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

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

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


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

    1. Initial program 44.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

    if -7.1999999999999999e140 < F < -3e-15

    1. Initial program 94.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 96.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+85.5%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+85.5%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub085.5%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg85.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      8. metadata-eval85.5%

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

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

    if -3e-15 < F < 6.5000000000000001e-117

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{F \cdot -1}{B}}{F}} - \frac{x}{\tan B} \]
      4. *-commutative51.6%

        \[\leadsto \frac{\frac{\color{blue}{-1 \cdot F}}{B}}{F} - \frac{x}{\tan B} \]
      5. neg-mul-151.6%

        \[\leadsto \frac{\frac{\color{blue}{-F}}{B}}{F} - \frac{x}{\tan B} \]
    12. Applied egg-rr51.6%

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

    if 6.5000000000000001e-117 < F < 1.60000000000000014e-85

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

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000014e-85 < F

    1. Initial program 65.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. Step-by-step derivation
      1. div-inv65.2%

        \[\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-num65.2%

        \[\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-rr65.2%

      \[\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 46.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{+140}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-117}:\\ \;\;\;\;\frac{-x}{\tan B} - \frac{\frac{F}{B}}{F}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-85}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 62.6% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-117}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\

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

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


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

    1. Initial program 44.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

    if -4.40000000000000028e143 < F < -3e-15

    1. Initial program 94.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 96.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+85.5%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+85.5%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub085.5%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg85.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      8. metadata-eval85.5%

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

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

    if -3e-15 < F < 2.40000000000000014e-117

    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 35.6%

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

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

    if 2.40000000000000014e-117 < F < 2.10000000000000001e-80

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

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000001e-80 < F

    1. Initial program 65.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. Step-by-step derivation
      1. div-inv65.2%

        \[\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-num65.2%

        \[\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-rr65.2%

      \[\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 46.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.4 \cdot 10^{+143}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-117}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-80}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 61.5% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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


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

    1. Initial program 44.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

    if -1.1500000000000001e141 < F < -3e-15

    1. Initial program 94.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 96.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+85.5%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+85.5%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub085.5%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg85.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      8. metadata-eval85.5%

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

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

    if -3e-15 < F

    1. Initial program 82.2%

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

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

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

      \[\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 65.0%

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

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

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

Alternative 19: 54.3% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{+144} \lor \neg \left(F \leq -2.9 \cdot 10^{-15}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= F -1.5e+144) (not (<= F -2.9e-15)))
   (- (/ -1.0 B) (/ x (tan B)))
   (- (/ -1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if ((F <= -1.5e+144) || !(F <= -2.9e-15)) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else {
		tmp = (-1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((f <= (-1.5d+144)) .or. (.not. (f <= (-2.9d-15)))) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((F <= -1.5e+144) || !(F <= -2.9e-15)) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (F <= -1.5e+144) or not (F <= -2.9e-15):
		tmp = (-1.0 / B) - (x / math.tan(B))
	else:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((F <= -1.5e+144) || !(F <= -2.9e-15))
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((F <= -1.5e+144) || ~((F <= -2.9e-15)))
		tmp = (-1.0 / B) - (x / tan(B));
	else
		tmp = (-1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[F, -1.5e+144], N[Not[LessEqual[F, -2.9e-15]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{+144} \lor \neg \left(F \leq -2.9 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -1.49999999999999995e144 or -2.90000000000000019e-15 < F

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

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

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

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

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

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

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

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

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

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

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

    if -1.49999999999999995e144 < F < -2.90000000000000019e-15

    1. Initial program 94.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 96.1%

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

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

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

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

        \[\leadsto \color{blue}{\left(0 - \frac{x}{B}\right)} - \frac{1}{\sin B} \]
      3. associate--r+85.5%

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

        \[\leadsto 0 - \color{blue}{\left(\frac{1}{\sin B} + \frac{x}{B}\right)} \]
      5. associate--r+85.5%

        \[\leadsto \color{blue}{\left(0 - \frac{1}{\sin B}\right) - \frac{x}{B}} \]
      6. neg-sub085.5%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      7. distribute-frac-neg85.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      8. metadata-eval85.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{+144} \lor \neg \left(F \leq -2.9 \cdot 10^{-15}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 54.2% accurate, 3.0× speedup?

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

\\
\frac{-1}{B} - \frac{x}{\tan B}
\end{array}
Derivation
  1. Initial program 78.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. Simplified85.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]
  9. Final simplification57.4%

    \[\leadsto \frac{-1}{B} - \frac{x}{\tan B} \]
  10. Add Preprocessing

Alternative 21: 37.2% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.2 \cdot 10^{-31}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -7.2e-31) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.2e-31) {
		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 <= (-7.2d-31)) 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 <= -7.2e-31) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -7.2e-31:
		tmp = (-1.0 - x) / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -7.2e-31)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -7.2e-31)
		tmp = (-1.0 - x) / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -7.2e-31], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{-31}:\\
\;\;\;\;\frac{-1 - x}{B}\\

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


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

    1. Initial program 71.4%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg46.7%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac246.7%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Simplified46.7%

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

    if -7.20000000000000007e-31 < F

    1. Initial program 81.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 44.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac227.8%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified27.8%

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

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

Alternative 22: 29.8% 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(Float64(-x) / B)
end
function tmp = code(F, B, x)
	tmp = -x / B;
end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-x}{B}
\end{array}
Derivation
  1. Initial program 78.1%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{-B}} \]
  8. Final simplification24.6%

    \[\leadsto \frac{-x}{B} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024072 
(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))))))