VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.0% → 98.1%
Time: 21.7s
Alternatives: 25
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 25 alternatives:

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

Initial Program: 76.0% 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: 98.1% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 55.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}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -1.05e16 < F < 1.75e-34

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

    if 1.75e-34 < 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. Taylor expanded in F around inf 99.6%

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

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

Alternative 2: 99.7% accurate, 0.6× speedup?

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

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

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

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.9%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -7e52 < F < 5e4

    1. Initial program 98.8%

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

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

    if 5e4 < F

    1. Initial program 58.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

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

Alternative 3: 99.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 55.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}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -6e15 < F < 5e4

    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 x around 0 99.6%

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

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

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

    if 5e4 < F

    1. Initial program 58.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.7%

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

Alternative 4: 98.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 55.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}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -1e16 < F < 1.75e-34

    1. Initial program 99.6%

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

    if 1.75e-34 < 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. Taylor expanded in F around inf 99.6%

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

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

Alternative 5: 99.2% accurate, 1.0× speedup?

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

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

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

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -1.4199999999999999 < F < 1.5

    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 0 98.2%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    5. Step-by-step derivation
      1. +-commutative98.3%

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

        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. associate-/l*98.2%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. un-div-inv98.3%

        \[\leadsto F \cdot \frac{\sqrt{0.5}}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    6. Applied egg-rr98.3%

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

    if 1.5 < F

    1. Initial program 58.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.1%

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

Alternative 6: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -1.4199999999999999 < F < 1.5

    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 0 98.2%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    5. Step-by-step derivation
      1. div-inv98.4%

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{F \cdot \sqrt{0.5}}{\sin B} \]
    6. Applied egg-rr98.4%

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

    if 1.5 < F

    1. Initial program 58.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.1%

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

Alternative 7: 91.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;F \leq -2.35 \cdot 10^{-66}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_1 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.2 \cdot 10^{-87}:\\
\;\;\;\;t\_0 + \frac{F \cdot \sqrt{0.5}}{B}\\

\mathbf{elif}\;F \leq 1.75 \cdot 10^{-34}:\\
\;\;\;\;t\_1 \cdot \left(F \cdot t\_2\right) - \frac{x}{B}\\

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


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

    1. Initial program 55.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}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -5.7e15 < F < -2.35e-66

    1. Initial program 99.6%

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

      \[\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 -2.35e-66 < F < 1.2e-87

    1. Initial program 99.6%

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

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

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

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

    if 1.2e-87 < F < 1.75e-34

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

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

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

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

    if 1.75e-34 < 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. Taylor expanded in F around inf 99.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.7 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.35 \cdot 10^{-66}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-34}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot \frac{1}{\sin B}\right) - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 72.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\
t_1 := F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{if}\;F \leq -2.05 \cdot 10^{+156}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq -0.305:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -1.02 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -2.0500000000000001e156 or -4.50000000000000017e81 < F < -0.304999999999999993

    1. Initial program 51.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 B around 0 35.9%

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

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

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

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

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

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

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

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

    if -2.0500000000000001e156 < F < -4.50000000000000017e81

    1. Initial program 73.3%

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

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

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

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

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

    if -0.304999999999999993 < F < -1.01999999999999996e-66 or 1.30000000000000001e-87 < F < 2.29999999999999984e-30

    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 0 94.4%

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

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

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

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    7. Simplified70.1%

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

    if -1.01999999999999996e-66 < F < 1.30000000000000001e-87

    1. Initial program 99.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\cos B}{-\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt45.0%

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

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

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod0.7%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.0%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.4%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod26.4%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg26.4%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod32.2%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt81.3%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub081.3%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr81.4%

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

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

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

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

    if 2.29999999999999984e-30 < F

    1. Initial program 59.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 B around 0 44.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{+81}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.305:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.02 \cdot 10^{-66}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-87}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 72.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\
t_1 := \frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{if}\;F \leq -1.95 \cdot 10^{+156}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq -0.27:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -9.2 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -1.9499999999999999e156 or -6.4999999999999996e81 < F < -0.27000000000000002

    1. Initial program 51.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 B around 0 35.9%

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

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

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

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

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

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

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

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

    if -1.9499999999999999e156 < F < -6.4999999999999996e81

    1. Initial program 73.3%

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

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

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

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

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

    if -0.27000000000000002 < F < -9.19999999999999967e-66 or 1.25000000000000011e-87 < F < 2.29999999999999984e-30

    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 0 94.4%

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

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

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

    if -9.19999999999999967e-66 < F < 1.25000000000000011e-87

    1. Initial program 99.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\cos B}{-\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt45.0%

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

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

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod0.7%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.0%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.4%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod26.4%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg26.4%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod32.2%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt81.3%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub081.3%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr81.4%

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

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

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

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

    if 2.29999999999999984e-30 < F

    1. Initial program 59.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 B around 0 44.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.95 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.5 \cdot 10^{+81}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.27:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -9.2 \cdot 10^{-66}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-87}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 82.6% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -0.55000000000000004 < F < -5.9999999999999998e-139 or 1.10000000000000011e-121 < F < 2.29999999999999984e-30

    1. Initial program 99.6%

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

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

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

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

    if -5.9999999999999998e-139 < F < 1.10000000000000011e-121

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\cos B}{-\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt43.2%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}} \]
      2. sqrt-unprod38.9%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\left(-\sin B\right) \cdot \left(-\sin B\right)}}} \]
      3. sqr-neg38.9%

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod0.7%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt1.8%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.3%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod26.0%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg26.0%

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

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt87.3%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub087.3%

        \[\leadsto \color{blue}{0 - x \cdot \frac{1}{\tan B}} \]
      14. un-div-inv87.4%

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr87.4%

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

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

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified87.4%

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

    if 2.29999999999999984e-30 < F

    1. Initial program 59.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 B around 0 44.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.55:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -6 \cdot 10^{-139}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 88.8% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -5.8 \cdot 10^{-143}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 1.75 \cdot 10^{-34}:\\
\;\;\;\;t\_0\\

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -0.28999999999999998 < F < -5.8000000000000002e-143 or 1.0000000000000001e-123 < F < 1.75e-34

    1. Initial program 99.6%

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

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

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

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

    if -5.8000000000000002e-143 < F < 1.0000000000000001e-123

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\cos B}{-\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt43.2%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}} \]
      2. sqrt-unprod38.9%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\left(-\sin B\right) \cdot \left(-\sin B\right)}}} \]
      3. sqr-neg38.9%

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod0.7%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt1.8%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.3%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod26.0%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg26.0%

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

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt87.3%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub087.3%

        \[\leadsto \color{blue}{0 - x \cdot \frac{1}{\tan B}} \]
      14. un-div-inv87.4%

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr87.4%

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

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

        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
    10. Simplified87.4%

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

    if 1.75e-34 < 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. Taylor expanded in F around inf 99.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.29:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.8 \cdot 10^{-143}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 10^{-123}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-34}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 91.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -5.4 \cdot 10^{-67}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-87}:\\
\;\;\;\;t\_1 + \frac{F \cdot \sqrt{0.5}}{B}\\

\mathbf{elif}\;F \leq 1.75 \cdot 10^{-34}:\\
\;\;\;\;t\_0\\

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -0.299999999999999989 < F < -5.40000000000000032e-67 or 1.09999999999999994e-87 < F < 1.75e-34

    1. Initial program 99.5%

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

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

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

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

    if -5.40000000000000032e-67 < F < 1.09999999999999994e-87

    1. Initial program 99.6%

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

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

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

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

    if 1.75e-34 < 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. Taylor expanded in F around inf 99.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.3:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5.4 \cdot 10^{-67}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-34}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 91.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -7.8 \cdot 10^{-65}:\\
\;\;\;\;t\_1 \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\

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

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

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


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

    1. Initial program 55.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}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -5.7e15 < F < -7.8000000000000007e-65

    1. Initial program 99.6%

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

      \[\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 -7.8000000000000007e-65 < F < 1.00000000000000002e-87

    1. Initial program 99.6%

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

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

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

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

    if 1.00000000000000002e-87 < F < 1.75e-34

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

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

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

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

    if 1.75e-34 < 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. Taylor expanded in F around inf 99.6%

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

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

Alternative 14: 79.1% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-65}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Step-by-step derivation
      1. +-commutative99.8%

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv99.9%

        \[\leadsto \frac{-1}{\sin B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr99.9%

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

    if -0.27000000000000002 < F < -2.99999999999999998e-65 or 1.1500000000000001e-87 < F < 2.29999999999999984e-30

    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 0 94.4%

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

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

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

    if -2.99999999999999998e-65 < F < 1.1500000000000001e-87

    1. Initial program 99.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\cos B}{-\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt45.0%

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

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

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod0.7%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.0%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.4%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod26.4%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg26.4%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod32.2%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt81.3%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub081.3%

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

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr81.4%

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

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

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

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

    if 2.29999999999999984e-30 < F

    1. Initial program 59.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 B around 0 44.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.27:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-65}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-87}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-30}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 71.0% accurate, 2.5× speedup?

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

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

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

\mathbf{elif}\;F \leq -1.1 \cdot 10^{+27}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 7200000000:\\
\;\;\;\;\frac{x}{-\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.9499999999999999e156 or -6.80000000000000005e81 < F < -1.0999999999999999e27

    1. Initial program 44.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 B around 0 35.6%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      2. mul-1-neg89.7%

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

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

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

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

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

    if -1.9499999999999999e156 < F < -6.80000000000000005e81

    1. Initial program 73.3%

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

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

    if -1.0999999999999999e27 < F < 7.2e9

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}} \]
      2. sqrt-unprod33.8%

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

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod1.0%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.2%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.3%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod20.6%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg20.6%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod26.5%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt66.8%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub066.8%

        \[\leadsto \color{blue}{0 - x \cdot \frac{1}{\tan B}} \]
      14. un-div-inv66.9%

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr66.9%

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

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

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

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

    if 7.2e9 < F

    1. Initial program 57.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.95 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{+81}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} - \frac{1}{B}\\ \mathbf{elif}\;F \leq -1.1 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7200000000:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 71.0% accurate, 2.5× speedup?

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

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

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

\mathbf{elif}\;F \leq -1.1 \cdot 10^{+27}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 7200000000:\\
\;\;\;\;\frac{x}{-\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.14999999999999993e156 or -6.99999999999999987e80 < F < -1.0999999999999999e27

    1. Initial program 44.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 B around 0 35.6%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + -1 \cdot \frac{x}{B}} \]
      2. mul-1-neg89.7%

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

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

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

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

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

    if -2.14999999999999993e156 < F < -6.99999999999999987e80

    1. Initial program 73.3%

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

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

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

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

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

    if -1.0999999999999999e27 < F < 7.2e9

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}} \]
      2. sqrt-unprod33.8%

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

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod1.0%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.2%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.3%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod20.6%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg20.6%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod26.5%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt66.8%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub066.8%

        \[\leadsto \color{blue}{0 - x \cdot \frac{1}{\tan B}} \]
      14. un-div-inv66.9%

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr66.9%

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

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

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

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

    if 7.2e9 < F

    1. Initial program 57.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.15 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7 \cdot 10^{+80}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.1 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7200000000:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 56.4% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.8 \cdot 10^{+113} \lor \neg \left(F \leq -6.8 \cdot 10^{+81}\right) \land F \leq -1.12 \cdot 10^{+27}:\\
\;\;\;\;\frac{-1}{\sin B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -3.8000000000000003e113 or -6.80000000000000005e81 < F < -1.12e27

    1. Initial program 49.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 39.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    7. Taylor expanded in B around inf 75.8%

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

    if -3.8000000000000003e113 < F < -6.80000000000000005e81 or -1.12e27 < F

    1. Initial program 84.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 39.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\cos B}{-\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt30.5%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}} \]
      2. sqrt-unprod28.9%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\left(-\sin B\right) \cdot \left(-\sin B\right)}}} \]
      3. sqr-neg28.9%

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod0.9%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.3%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.2%

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg17.2%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod22.8%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt56.8%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub056.8%

        \[\leadsto \color{blue}{0 - x \cdot \frac{1}{\tan B}} \]
      14. un-div-inv56.9%

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr56.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{+113} \lor \neg \left(F \leq -6.8 \cdot 10^{+81}\right) \land F \leq -1.12 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 37.5% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -3.5 \cdot 10^{+81}:\\
\;\;\;\;\frac{-1 - x}{B}\\

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

\mathbf{elif}\;F \leq 3.2 \cdot 10^{+46}:\\
\;\;\;\;\frac{x}{-B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.8e152 or -3.5e81 < F < -3.19999999999999986e-5

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]
    7. Taylor expanded in B around inf 71.5%

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

    if -3.8e152 < F < -3.5e81

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac266.8%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified66.8%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in B around 0 66.8%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in66.8%

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

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-166.8%

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

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    9. Simplified66.8%

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

    if -3.19999999999999986e-5 < F < 3.1999999999999998e46

    1. Initial program 98.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg26.0%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac226.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified26.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 39.5%

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

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

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    9. Simplified39.5%

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

    if 3.1999999999999998e46 < F

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg17.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac217.3%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity17.3%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. +-commutative17.3%

        \[\leadsto 1 \cdot \frac{\color{blue}{x + 1}}{-B} \]
      3. add-sqr-sqrt9.0%

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

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}} \]
      5. sqr-neg18.2%

        \[\leadsto 1 \cdot \frac{x + 1}{\sqrt{\color{blue}{B \cdot B}}} \]
      6. sqrt-prod11.6%

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      7. add-sqr-sqrt26.7%

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

      \[\leadsto \color{blue}{1 \cdot \frac{x + 1}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity26.7%

        \[\leadsto \color{blue}{\frac{x + 1}{B}} \]
      2. +-commutative26.7%

        \[\leadsto \frac{\color{blue}{1 + x}}{B} \]
    10. Simplified26.7%

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification44.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{+152}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -3.5 \cdot 10^{+81}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+46}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 71.1% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq 7200000000:\\
\;\;\;\;\frac{x}{-\tan B}\\

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


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

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

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

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

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

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

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

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

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

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

    if -1.0999999999999999e27 < F < 7.2e9

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}} \]
      2. sqrt-unprod33.8%

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

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod1.0%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.2%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.3%

        \[\leadsto \color{blue}{\sqrt{x \cdot \frac{1}{\tan B}} \cdot \sqrt{x \cdot \frac{1}{\tan B}}} \]
      9. sqrt-unprod20.6%

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg20.6%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod26.5%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt66.8%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub066.8%

        \[\leadsto \color{blue}{0 - x \cdot \frac{1}{\tan B}} \]
      14. un-div-inv66.9%

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr66.9%

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

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

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

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

    if 7.2e9 < F

    1. Initial program 57.1%

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

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

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

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

Alternative 20: 62.6% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.1 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.1e+27) (- (/ -1.0 (sin B)) (/ x B)) (/ x (- (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.1e+27) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else {
		tmp = 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 <= (-1.1d+27)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else
        tmp = x / -tan(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.1e+27) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = x / -Math.tan(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.1e+27:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	else:
		tmp = x / -math.tan(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.1e+27)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(x / Float64(-tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.1e+27)
		tmp = (-1.0 / sin(B)) - (x / B);
	else
		tmp = x / -tan(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.1e+27], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}

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

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


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

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

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

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

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

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

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

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

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

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

    if -1.0999999999999999e27 < F

    1. Initial program 84.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 37.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\cos B}{-\sin B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt29.4%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{-\sin B} \cdot \sqrt{-\sin B}}} \]
      2. sqrt-unprod27.8%

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

        \[\leadsto x \cdot \frac{\cos B}{\sqrt{\color{blue}{\sin B \cdot \sin B}}} \]
      4. sqrt-unprod0.9%

        \[\leadsto x \cdot \frac{\cos B}{\color{blue}{\sqrt{\sin B} \cdot \sqrt{\sin B}}} \]
      5. add-sqr-sqrt2.4%

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{\tan B}} \]
      8. add-sqr-sqrt1.2%

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

        \[\leadsto \color{blue}{\sqrt{\left(x \cdot \frac{1}{\tan B}\right) \cdot \left(x \cdot \frac{1}{\tan B}\right)}} \]
      10. sqr-neg16.7%

        \[\leadsto \sqrt{\color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) \cdot \left(-x \cdot \frac{1}{\tan B}\right)}} \]
      11. sqrt-unprod22.4%

        \[\leadsto \color{blue}{\sqrt{-x \cdot \frac{1}{\tan B}} \cdot \sqrt{-x \cdot \frac{1}{\tan B}}} \]
      12. add-sqr-sqrt55.6%

        \[\leadsto \color{blue}{-x \cdot \frac{1}{\tan B}} \]
      13. neg-sub055.6%

        \[\leadsto \color{blue}{0 - x \cdot \frac{1}{\tan B}} \]
      14. un-div-inv55.7%

        \[\leadsto 0 - \color{blue}{\frac{x}{\tan B}} \]
    8. Applied egg-rr55.7%

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

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

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

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

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

Alternative 21: 37.1% accurate, 14.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.8 \cdot 10^{-32}:\\ \;\;\;\;\left(B \cdot -0.16666666666666666 + x \cdot \left(B \cdot 0.3333333333333333 + \frac{-1}{B}\right)\right) + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{+48}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5.8e-32)
   (+
    (+
     (* B -0.16666666666666666)
     (* x (+ (* B 0.3333333333333333) (/ -1.0 B))))
    (/ -1.0 B))
   (if (<= F 4.8e+48) (/ x (- B)) (/ (+ x 1.0) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.8e-32) {
		tmp = ((B * -0.16666666666666666) + (x * ((B * 0.3333333333333333) + (-1.0 / B)))) + (-1.0 / B);
	} else if (F <= 4.8e+48) {
		tmp = x / -B;
	} else {
		tmp = (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 <= (-5.8d-32)) then
        tmp = ((b * (-0.16666666666666666d0)) + (x * ((b * 0.3333333333333333d0) + ((-1.0d0) / b)))) + ((-1.0d0) / b)
    else if (f <= 4.8d+48) then
        tmp = x / -b
    else
        tmp = (x + 1.0d0) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -5.8e-32) {
		tmp = ((B * -0.16666666666666666) + (x * ((B * 0.3333333333333333) + (-1.0 / B)))) + (-1.0 / B);
	} else if (F <= 4.8e+48) {
		tmp = x / -B;
	} else {
		tmp = (x + 1.0) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -5.8e-32:
		tmp = ((B * -0.16666666666666666) + (x * ((B * 0.3333333333333333) + (-1.0 / B)))) + (-1.0 / B)
	elif F <= 4.8e+48:
		tmp = x / -B
	else:
		tmp = (x + 1.0) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -5.8e-32)
		tmp = Float64(Float64(Float64(B * -0.16666666666666666) + Float64(x * Float64(Float64(B * 0.3333333333333333) + Float64(-1.0 / B)))) + Float64(-1.0 / B));
	elseif (F <= 4.8e+48)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(x + 1.0) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -5.8e-32)
		tmp = ((B * -0.16666666666666666) + (x * ((B * 0.3333333333333333) + (-1.0 / B)))) + (-1.0 / B);
	elseif (F <= 4.8e+48)
		tmp = x / -B;
	else
		tmp = (x + 1.0) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -5.8e-32], N[(N[(N[(B * -0.16666666666666666), $MachinePrecision] + N[(x * N[(N[(B * 0.3333333333333333), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.8e+48], N[(x / (-B)), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.8 \cdot 10^{-32}:\\
\;\;\;\;\left(B \cdot -0.16666666666666666 + x \cdot \left(B \cdot 0.3333333333333333 + \frac{-1}{B}\right)\right) + \frac{-1}{B}\\

\mathbf{elif}\;F \leq 4.8 \cdot 10^{+48}:\\
\;\;\;\;\frac{x}{-B}\\

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


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

    1. Initial program 61.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 92.5%

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

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

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

    if -5.79999999999999991e-32 < F < 4.8000000000000002e48

    1. Initial program 98.8%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac226.1%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified26.1%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 40.1%

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac240.1%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    9. Simplified40.1%

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

    if 4.8000000000000002e48 < F

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg17.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac217.3%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity17.3%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. +-commutative17.3%

        \[\leadsto 1 \cdot \frac{\color{blue}{x + 1}}{-B} \]
      3. add-sqr-sqrt9.0%

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

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}} \]
      5. sqr-neg18.2%

        \[\leadsto 1 \cdot \frac{x + 1}{\sqrt{\color{blue}{B \cdot B}}} \]
      6. sqrt-prod11.6%

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      7. add-sqr-sqrt26.7%

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

      \[\leadsto \color{blue}{1 \cdot \frac{x + 1}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity26.7%

        \[\leadsto \color{blue}{\frac{x + 1}{B}} \]
      2. +-commutative26.7%

        \[\leadsto \frac{\color{blue}{1 + x}}{B} \]
    10. Simplified26.7%

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification39.9%

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

Alternative 22: 30.6% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{+44}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3.2e-5)
   (/ -1.0 B)
   (if (<= F 5.2e+44) (/ x (- B)) (/ (+ x 1.0) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.2e-5) {
		tmp = -1.0 / B;
	} else if (F <= 5.2e+44) {
		tmp = x / -B;
	} else {
		tmp = (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.2d-5)) then
        tmp = (-1.0d0) / b
    else if (f <= 5.2d+44) then
        tmp = x / -b
    else
        tmp = (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.2e-5) {
		tmp = -1.0 / B;
	} else if (F <= 5.2e+44) {
		tmp = x / -B;
	} else {
		tmp = (x + 1.0) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3.2e-5:
		tmp = -1.0 / B
	elif F <= 5.2e+44:
		tmp = x / -B
	else:
		tmp = (x + 1.0) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.2e-5)
		tmp = Float64(-1.0 / B);
	elseif (F <= 5.2e+44)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(x + 1.0) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3.2e-5)
		tmp = -1.0 / B;
	elseif (F <= 5.2e+44)
		tmp = x / -B;
	else
		tmp = (x + 1.0) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-5], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 5.2e+44], N[(x / (-B)), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;F \leq 5.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{x}{-B}\\

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac251.5%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified51.5%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 38.4%

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

    if -3.19999999999999986e-5 < F < 5.1999999999999998e44

    1. Initial program 98.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg26.0%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac226.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified26.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 39.5%

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

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

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    9. Simplified39.5%

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

    if 5.1999999999999998e44 < F

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg17.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac217.3%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity17.3%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. +-commutative17.3%

        \[\leadsto 1 \cdot \frac{\color{blue}{x + 1}}{-B} \]
      3. add-sqr-sqrt9.0%

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

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}} \]
      5. sqr-neg18.2%

        \[\leadsto 1 \cdot \frac{x + 1}{\sqrt{\color{blue}{B \cdot B}}} \]
      6. sqrt-prod11.6%

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      7. add-sqr-sqrt26.7%

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

      \[\leadsto \color{blue}{1 \cdot \frac{x + 1}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity26.7%

        \[\leadsto \color{blue}{\frac{x + 1}{B}} \]
      2. +-commutative26.7%

        \[\leadsto \frac{\color{blue}{1 + x}}{B} \]
    10. Simplified26.7%

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

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

Alternative 23: 37.0% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{+45}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.55e-28)
   (/ (- -1.0 x) B)
   (if (<= F 3.6e+45) (/ x (- B)) (/ (+ x 1.0) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.55e-28) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.6e+45) {
		tmp = x / -B;
	} else {
		tmp = (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.55d-28)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 3.6d+45) then
        tmp = x / -b
    else
        tmp = (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.55e-28) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 3.6e+45) {
		tmp = x / -B;
	} else {
		tmp = (x + 1.0) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.55e-28:
		tmp = (-1.0 - x) / B
	elif F <= 3.6e+45:
		tmp = x / -B
	else:
		tmp = (x + 1.0) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.55e-28)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 3.6e+45)
		tmp = Float64(x / Float64(-B));
	else
		tmp = Float64(Float64(x + 1.0) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.55e-28)
		tmp = (-1.0 - x) / B;
	elseif (F <= 3.6e+45)
		tmp = x / -B;
	else
		tmp = (x + 1.0) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.55e-28], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e+45], N[(x / (-B)), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 3.6 \cdot 10^{+45}:\\
\;\;\;\;\frac{x}{-B}\\

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


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

    1. Initial program 61.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 92.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg49.9%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac249.9%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified49.9%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in B around 0 49.9%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in49.9%

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

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-149.9%

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

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    9. Simplified49.9%

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

    if -1.54999999999999996e-28 < F < 3.6e45

    1. Initial program 98.8%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac226.1%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified26.1%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 40.1%

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

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-neg-frac240.1%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    9. Simplified40.1%

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

    if 3.6e45 < F

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg17.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac217.3%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity17.3%

        \[\leadsto \color{blue}{1 \cdot \frac{1 + x}{-B}} \]
      2. +-commutative17.3%

        \[\leadsto 1 \cdot \frac{\color{blue}{x + 1}}{-B} \]
      3. add-sqr-sqrt9.0%

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

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{\left(-B\right) \cdot \left(-B\right)}}} \]
      5. sqr-neg18.2%

        \[\leadsto 1 \cdot \frac{x + 1}{\sqrt{\color{blue}{B \cdot B}}} \]
      6. sqrt-prod11.6%

        \[\leadsto 1 \cdot \frac{x + 1}{\color{blue}{\sqrt{B} \cdot \sqrt{B}}} \]
      7. add-sqr-sqrt26.7%

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

      \[\leadsto \color{blue}{1 \cdot \frac{x + 1}{B}} \]
    9. Step-by-step derivation
      1. *-lft-identity26.7%

        \[\leadsto \color{blue}{\frac{x + 1}{B}} \]
      2. +-commutative26.7%

        \[\leadsto \frac{\color{blue}{1 + x}}{B} \]
    10. Simplified26.7%

      \[\leadsto \color{blue}{\frac{1 + x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.55 \cdot 10^{-28}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{+45}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + 1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 30.0% accurate, 35.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x) :precision binary64 (if (<= F -3.2e-5) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3.2e-5) {
		tmp = -1.0 / 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 <= (-3.2d-5)) then
        tmp = (-1.0d0) / 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 <= -3.2e-5) {
		tmp = -1.0 / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3.2e-5:
		tmp = -1.0 / B
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3.2e-5)
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(x / Float64(-B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3.2e-5)
		tmp = -1.0 / B;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-5], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{B}\\

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


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

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac251.5%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified51.5%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 38.4%

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

    if -3.19999999999999986e-5 < F

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg23.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac223.3%

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

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 32.6%

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

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

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    9. Simplified32.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 10.6% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 77.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 51.7%

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

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

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    2. distribute-neg-frac230.8%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  6. Simplified30.8%

    \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  7. Taylor expanded in x around 0 13.2%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  8. Final simplification13.2%

    \[\leadsto \frac{-1}{B} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024112 
(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))))))