VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.6% → 99.6%
Time: 19.2s
Alternatives: 24
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.6× speedup?

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

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

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

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u47.0%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv46.8%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-146.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr46.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def47.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp40.6%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef40.6%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-140.6%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp37.0%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative37.0%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp40.6%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.8%

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

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

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

    if -1e30 < F < 4e4

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

    if 4e4 < F

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u54.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)\right)} \]
      2. expm1-udef54.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)} - 1} \]
      3. div-inv54.6%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{1}{\sin B}\right)} - 1 \]
      4. neg-mul-154.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{1}{\sin B}\right)} - 1 \]
      5. fma-def54.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr54.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def54.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)} \]
      3. fma-udef99.7%

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

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

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

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

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

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

Alternative 2: 99.7% accurate, 0.8× speedup?

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

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

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

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


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

    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. Taylor expanded in F around -inf 99.8%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)\right)} \]
      2. expm1-udef46.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv46.7%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-146.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def46.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr46.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.3%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.3%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.3%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp37.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative37.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.3%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.8%

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

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

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

    if -5e8 < F < 1.05e8

    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. Taylor expanded in x around 0 99.6%

      \[\leadsto \left(-\color{blue}{\frac{\cos B \cdot x}{\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 1.05e8 < F

    1. Initial program 60.0%

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)\right)} \]
      2. expm1-udef55.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)} - 1} \]
      3. div-inv55.4%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{1}{\sin B}\right)} - 1 \]
      4. neg-mul-155.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{1}{\sin B}\right)} - 1 \]
      5. fma-def55.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr55.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def55.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)} \]
      3. fma-udef99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -500000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 105000000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x \cdot \cos B}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    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. Taylor expanded in F around -inf 99.8%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)\right)} \]
      2. expm1-udef46.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv46.7%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-146.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. fma-def46.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr46.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def46.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.3%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.3%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.3%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp37.8%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative37.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.3%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.8%

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

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

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

    if -1.02e8 < F < 4e4

    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)} \]

    if 4e4 < F

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u54.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)\right)} \]
      2. expm1-udef54.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)} - 1} \]
      3. div-inv54.6%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{1}{\sin B}\right)} - 1 \]
      4. neg-mul-154.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{1}{\sin B}\right)} - 1 \]
      5. fma-def54.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr54.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def54.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)} \]
      3. fma-udef99.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -102000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 40000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 4: 99.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.84:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\frac{\sin B \cdot \left(-1 - x\right)}{F} - F \cdot \sin B}\\

\mathbf{elif}\;F \leq 0.00095:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\

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


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

    1. Initial program 50.6%

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

        \[\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. +-commutative60.5%

        \[\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. *-commutative60.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\frac{\left(\color{blue}{-1} + -0.5 \cdot \left(2 \cdot x\right)\right) \cdot \sin B}{F} - \sin B \cdot F} \]
      7. associate-*r*99.6%

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

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

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

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

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

    if -0.839999999999999969 < F < 9.49999999999999998e-4

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

    if 9.49999999999999998e-4 < F

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u52.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)\right)} \]
      2. expm1-udef52.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)} - 1} \]
      3. div-inv52.6%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{1}{\sin B}\right)} - 1 \]
      4. neg-mul-152.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{1}{\sin B}\right)} - 1 \]
      5. fma-def52.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr52.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def52.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)} \]
      3. fma-udef98.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      6. unsub-neg98.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.84:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\frac{\sin B \cdot \left(-1 - x\right)}{F} - F \cdot \sin B}\\ \mathbf{elif}\;F \leq 0.00095:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 5: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.00095:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)\right)} \]
      2. expm1-udef47.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv47.2%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-147.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr47.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.8%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.8%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp38.4%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative38.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.5%

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

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

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

    if -1.3999999999999999 < F < 9.49999999999999998e-4

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

    if 9.49999999999999998e-4 < F

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u52.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)\right)} \]
      2. expm1-udef52.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)} - 1} \]
      3. div-inv52.6%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{1}{\sin B}\right)} - 1 \]
      4. neg-mul-152.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{1}{\sin B}\right)} - 1 \]
      5. fma-def52.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr52.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def52.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)} \]
      3. fma-udef98.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      6. unsub-neg98.7%

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

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

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

Alternative 6: 92.1% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.00095:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)\right)} \]
      2. expm1-udef47.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv47.2%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-147.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr47.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.8%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.8%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp38.4%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative38.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.5%

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

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

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

    if -0.55000000000000004 < F < 9.49999999999999998e-4

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

    if 9.49999999999999998e-4 < F

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u52.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)\right)} \]
      2. expm1-udef52.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)} - 1} \]
      3. div-inv52.6%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{1}{\sin B}\right)} - 1 \]
      4. neg-mul-152.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{1}{\sin B}\right)} - 1 \]
      5. fma-def52.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr52.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def52.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)} \]
      3. fma-udef98.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{\tan B}\right)} \]
      6. unsub-neg98.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.55:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.00095:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 7: 71.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -3.7 \cdot 10^{-87}:\\
\;\;\;\;\frac{-F}{F \cdot B} - t_0\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\


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

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

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

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

    if -1.00000000000000004e154 < F < -3.7000000000000002e-87

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
    4. Step-by-step derivation
      1. expm1-log1p-u27.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)\right)} \]
      2. expm1-udef27.1%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)} - 1} \]
      3. +-commutative27.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{B} \cdot \frac{-1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      4. fma-def27.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      5. div-inv27.1%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def27.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)\right)} \]
      2. expm1-log1p66.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)} \]
      3. fma-neg66.9%

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

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      5. times-frac70.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot F}{F \cdot B}} - \frac{x}{\tan B} \]
      6. mul-1-neg70.8%

        \[\leadsto \frac{\color{blue}{-F}}{F \cdot B} - \frac{x}{\tan B} \]
    7. Simplified70.8%

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

    if -3.7000000000000002e-87 < F < 6.39999999999999963e-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. Taylor expanded in F around -inf 41.9%

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

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

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

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

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

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

    if 6.39999999999999963e-66 < F

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-87}:\\ \;\;\;\;\frac{-F}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.4 \cdot 10^{-66}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 8: 71.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq -7.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{-F}{F \cdot B} - t_0\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\


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

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

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

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

    if -2.3e154 < F < -7.6e-87

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
    4. Step-by-step derivation
      1. expm1-log1p-u27.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)\right)} \]
      2. expm1-udef27.1%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)} - 1} \]
      3. +-commutative27.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{B} \cdot \frac{-1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      4. fma-def27.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      5. div-inv27.1%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def27.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)\right)} \]
      2. expm1-log1p66.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)} \]
      3. fma-neg66.9%

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

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      5. times-frac70.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot F}{F \cdot B}} - \frac{x}{\tan B} \]
      6. mul-1-neg70.8%

        \[\leadsto \frac{\color{blue}{-F}}{F \cdot B} - \frac{x}{\tan B} \]
    7. Simplified70.8%

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

    if -7.6e-87 < F < 2e-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. Taylor expanded in F around -inf 41.9%

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

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

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

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

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

    if 2e-66 < F

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.6 \cdot 10^{-87}:\\ \;\;\;\;\frac{-F}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-66}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 9: 85.7% accurate, 1.5× speedup?

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

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

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

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


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)\right)} \]
      2. expm1-udef47.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv47.2%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-147.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr47.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.8%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.8%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp38.4%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative38.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.5%

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

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

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

    if -6.5000000000000003e-9 < F < 5.5000000000000003e-45

    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. Taylor expanded in F around -inf 42.4%

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

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

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

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

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

    if 5.5000000000000003e-45 < F

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u50.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)\right)} \]
      2. expm1-udef50.1%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\right)} - 1} \]
      3. div-inv50.1%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{1}{\sin B}\right)} - 1 \]
      4. neg-mul-150.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{-1 \cdot \frac{x}{\tan B}} + \frac{1}{\sin B}\right)} - 1 \]
      5. fma-def50.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr50.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def50.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p94.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 5.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 10: 78.5% accurate, 1.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\


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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)\right)} \]
      2. expm1-udef47.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. div-inv47.2%

        \[\leadsto e^{\mathsf{log1p}\left(\left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{\sin B}\right)} - 1 \]
      4. neg-mul-147.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} - 1 \]
    4. Applied egg-rr47.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def47.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)\right)\right)} \]
      2. expm1-log1p99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)} \]
      3. rem-log-exp41.8%

        \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{-1}{\sin B}\right)}\right)} \]
      4. fma-udef41.8%

        \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \frac{x}{\tan B} + \frac{-1}{\sin B}}}\right) \]
      5. neg-mul-141.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(-\frac{x}{\tan B}\right)} + \frac{-1}{\sin B}}\right) \]
      6. prod-exp38.4%

        \[\leadsto \log \color{blue}{\left(e^{-\frac{x}{\tan B}} \cdot e^{\frac{-1}{\sin B}}\right)} \]
      7. *-commutative38.4%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B}} \cdot e^{-\frac{x}{\tan B}}\right)} \]
      8. prod-exp41.8%

        \[\leadsto \log \color{blue}{\left(e^{\frac{-1}{\sin B} + \left(-\frac{x}{\tan B}\right)}\right)} \]
      9. rem-log-exp99.5%

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

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

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

    if -6.5000000000000003e-9 < F < 1.55e-68

    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. Taylor expanded in F around -inf 42.5%

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

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

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

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

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

    if 1.55e-68 < F

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{-68}:\\ \;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 11: 63.0% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -4 \cdot 10^{-68}:\\
\;\;\;\;\frac{-F}{F \cdot B} - t_0\\

\mathbf{elif}\;F \leq 1.35 \cdot 10^{-73}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\


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

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

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

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

    if -5.1999999999999997e147 < F < -4.00000000000000027e-68

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
    4. Step-by-step derivation
      1. expm1-log1p-u31.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)\right)} \]
      2. expm1-udef30.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)} - 1} \]
      3. +-commutative30.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{B} \cdot \frac{-1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      4. fma-def30.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      5. div-inv30.9%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\color{blue}{\frac{x}{\tan B}}\right)\right)} - 1 \]
    5. Applied egg-rr30.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def31.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)\right)} \]
      2. expm1-log1p71.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)} \]
      3. fma-neg71.4%

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

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      5. times-frac75.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot F}{F \cdot B}} - \frac{x}{\tan B} \]
      6. mul-1-neg75.9%

        \[\leadsto \frac{\color{blue}{-F}}{F \cdot B} - \frac{x}{\tan B} \]
    7. Simplified75.9%

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

    if -4.00000000000000027e-68 < F < 1.34999999999999997e-73

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B}} \]
    6. Taylor expanded in F around -inf 64.1%

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

    if 1.34999999999999997e-73 < F

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.2 \cdot 10^{+147}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4 \cdot 10^{-68}:\\ \;\;\;\;\frac{-F}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.35 \cdot 10^{-73}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 12: 53.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{-91}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-113}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;x \leq -2.25 \cdot 10^{-136}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}}\\ \mathbf{elif}\;x \leq 3300000:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ 1.0 B) (/ x (tan B)))))
   (if (<= x -1.35e-91)
     t_0
     (if (<= x -1.35e-113)
       (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x)))
       (if (<= x -2.25e-136)
         t_0
         (if (<= x 5.5e-129)
           (/ (sqrt 0.5) (/ B F))
           (if (<= x 3300000.0)
             (* x (+ (/ -1.0 B) (* B 0.3333333333333333)))
             t_0)))))))
double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / tan(B));
	double tmp;
	if (x <= -1.35e-91) {
		tmp = t_0;
	} else if (x <= -1.35e-113) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (x <= -2.25e-136) {
		tmp = t_0;
	} else if (x <= 5.5e-129) {
		tmp = sqrt(0.5) / (B / F);
	} else if (x <= 3300000.0) {
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (1.0d0 / b) - (x / tan(b))
    if (x <= (-1.35d-91)) then
        tmp = t_0
    else if (x <= (-1.35d-113)) then
        tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
    else if (x <= (-2.25d-136)) then
        tmp = t_0
    else if (x <= 5.5d-129) then
        tmp = sqrt(0.5d0) / (b / f)
    else if (x <= 3300000.0d0) then
        tmp = x * (((-1.0d0) / b) + (b * 0.3333333333333333d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = (1.0 / B) - (x / Math.tan(B));
	double tmp;
	if (x <= -1.35e-91) {
		tmp = t_0;
	} else if (x <= -1.35e-113) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (x <= -2.25e-136) {
		tmp = t_0;
	} else if (x <= 5.5e-129) {
		tmp = Math.sqrt(0.5) / (B / F);
	} else if (x <= 3300000.0) {
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (1.0 / B) - (x / math.tan(B))
	tmp = 0
	if x <= -1.35e-91:
		tmp = t_0
	elif x <= -1.35e-113:
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x))
	elif x <= -2.25e-136:
		tmp = t_0
	elif x <= 5.5e-129:
		tmp = math.sqrt(0.5) / (B / F)
	elif x <= 3300000.0:
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333))
	else:
		tmp = t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(1.0 / B) - Float64(x / tan(B)))
	tmp = 0.0
	if (x <= -1.35e-91)
		tmp = t_0;
	elseif (x <= -1.35e-113)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x)));
	elseif (x <= -2.25e-136)
		tmp = t_0;
	elseif (x <= 5.5e-129)
		tmp = Float64(sqrt(0.5) / Float64(B / F));
	elseif (x <= 3300000.0)
		tmp = Float64(x * Float64(Float64(-1.0 / B) + Float64(B * 0.3333333333333333)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = (1.0 / B) - (x / tan(B));
	tmp = 0.0;
	if (x <= -1.35e-91)
		tmp = t_0;
	elseif (x <= -1.35e-113)
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	elseif (x <= -2.25e-136)
		tmp = t_0;
	elseif (x <= 5.5e-129)
		tmp = sqrt(0.5) / (B / F);
	elseif (x <= 3300000.0)
		tmp = x * ((-1.0 / B) + (B * 0.3333333333333333));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e-91], t$95$0, If[LessEqual[x, -1.35e-113], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.25e-136], t$95$0, If[LessEqual[x, 5.5e-129], N[(N[Sqrt[0.5], $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3300000.0], N[(x * N[(N[(-1.0 / B), $MachinePrecision] + N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{-91}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq -1.35 \cdot 10^{-113}:\\
\;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\

\mathbf{elif}\;x \leq -2.25 \cdot 10^{-136}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 3300000:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.3499999999999999e-91 or -1.34999999999999998e-113 < x < -2.24999999999999986e-136 or 3.3e6 < x

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

    if -1.3499999999999999e-91 < x < -1.34999999999999998e-113

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

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

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

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

    if -2.24999999999999986e-136 < x < 5.50000000000000023e-129

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} \]
    8. Simplified31.7%

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

    if 5.50000000000000023e-129 < x < 3.3e6

    1. Initial program 77.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{-91}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-113}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;x \leq -2.25 \cdot 10^{-136}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-129}:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}}\\ \mathbf{elif}\;x \leq 3300000:\\ \;\;\;\;x \cdot \left(\frac{-1}{B} + B \cdot 0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 13: 60.8% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq -1 \cdot 10^{+55}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq -1.4 \cdot 10^{-22}:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.4999999999999997e143 or -1.00000000000000001e55 < F < -1.39999999999999997e-22

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

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

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

    if -4.4999999999999997e143 < F < -1.00000000000000001e55 or 1.59999999999999988e-75 < F

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

    if -1.39999999999999997e-22 < F < 1.59999999999999988e-75

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{0.5} \cdot F} - x}{B} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.5 \cdot 10^{+143}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1 \cdot 10^{+55}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.4 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{-75}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 14: 62.9% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;F \leq -2.26 \cdot 10^{-67}:\\
\;\;\;\;\frac{-F}{F \cdot B} - t_0\\

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\


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

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

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

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

    if -8.00000000000000006e155 < F < -2.2600000000000001e-67

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot \frac{-1}{F} \]
    4. Step-by-step derivation
      1. expm1-log1p-u31.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)\right)} \]
      2. expm1-udef30.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\right)} - 1} \]
      3. +-commutative30.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{F}{B} \cdot \frac{-1}{F} + \left(-x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      4. fma-def30.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -x \cdot \frac{1}{\tan B}\right)}\right)} - 1 \]
      5. div-inv30.9%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\color{blue}{\frac{x}{\tan B}}\right)\right)} - 1 \]
    5. Applied egg-rr30.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def31.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)\right)\right)} \]
      2. expm1-log1p71.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{B}, \frac{-1}{F}, -\frac{x}{\tan B}\right)} \]
      3. fma-neg71.4%

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

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{F}{B}} - \frac{x}{\tan B} \]
      5. times-frac75.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot F}{F \cdot B}} - \frac{x}{\tan B} \]
      6. mul-1-neg75.9%

        \[\leadsto \frac{\color{blue}{-F}}{F \cdot B} - \frac{x}{\tan B} \]
    7. Simplified75.9%

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

    if -2.2600000000000001e-67 < F < 4.80000000000000039e-75

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

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

    if 4.80000000000000039e-75 < F

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8 \cdot 10^{+155}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.26 \cdot 10^{-67}:\\ \;\;\;\;\frac{-F}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-75}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 15: 62.9% accurate, 2.9× speedup?

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

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

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

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

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


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

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

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

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

    if -5.69999999999999998e156 < F < -6.8000000000000002e-67

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

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

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

    if -6.8000000000000002e-67 < F < 3.89999999999999982e-73

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

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

    if 3.89999999999999982e-73 < F

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.7 \cdot 10^{+156}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 3.9 \cdot 10^{-73}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 16: 55.9% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq -2.35 \cdot 10^{-79} \lor \neg \left(B \leq 6.4 \cdot 10^{-80}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < -2.3500000000000001e-79 or 6.3999999999999998e-80 < B

    1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

    if -2.3500000000000001e-79 < B < 6.3999999999999998e-80

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{0.5} \cdot F} - x}{B} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq -2.35 \cdot 10^{-79} \lor \neg \left(B \leq 6.4 \cdot 10^{-80}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \end{array} \]

Alternative 17: 44.2% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-87}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e-87)
   (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x)))
   (if (<= F 6.8e-66)
     (/ (- x) B)
     (+
      (* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
      (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-87) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 6.8e-66) {
		tmp = -x / B;
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-3d-87)) then
        tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
    else if (f <= 6.8d-66) then
        tmp = -x / b
    else
        tmp = (b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-87) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 6.8e-66) {
		tmp = -x / B;
	} else {
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e-87:
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x))
	elif F <= 6.8e-66:
		tmp = -x / B
	else:
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e-87)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x)));
	elseif (F <= 6.8e-66)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -3e-87)
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	elseif (F <= 6.8e-66)
		tmp = -x / B;
	else
		tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e-87], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.8e-66], N[((-x) / B), $MachinePrecision], N[(N[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 6.8 \cdot 10^{-66}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\


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

    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. Taylor expanded in F around -inf 72.1%

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

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

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

    if -3.00000000000000016e-87 < F < 6.79999999999999994e-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. Taylor expanded in F around -inf 41.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 42.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified42.4%

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

    if 6.79999999999999994e-66 < F

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

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

      \[\leadsto \color{blue}{\left(\left(0.16666666666666666 + 0.3333333333333333 \cdot x\right) \cdot B + \frac{1}{B}\right) - \frac{x}{B}} \]
    4. Step-by-step derivation
      1. associate--l+48.5%

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

        \[\leadsto \color{blue}{B \cdot \left(0.16666666666666666 + 0.3333333333333333 \cdot x\right)} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      3. *-commutative48.5%

        \[\leadsto B \cdot \left(0.16666666666666666 + \color{blue}{x \cdot 0.3333333333333333}\right) + \left(\frac{1}{B} - \frac{x}{B}\right) \]
      4. div-sub48.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-87}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 6.8 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 18: 44.3% accurate, 18.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{if}\;F \leq -1.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B} + t_0\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + t_0\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* 0.3333333333333333 (* B x))))
   (if (<= F -1.5e-86)
     (+ (/ (- -1.0 x) B) t_0)
     (if (<= F 4.2e-69) (/ (- x) B) (- (+ (/ 1.0 B) t_0) (/ x B))))))
double code(double F, double B, double x) {
	double t_0 = 0.3333333333333333 * (B * x);
	double tmp;
	if (F <= -1.5e-86) {
		tmp = ((-1.0 - x) / B) + t_0;
	} else if (F <= 4.2e-69) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + t_0) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.3333333333333333d0 * (b * x)
    if (f <= (-1.5d-86)) then
        tmp = (((-1.0d0) - x) / b) + t_0
    else if (f <= 4.2d-69) then
        tmp = -x / b
    else
        tmp = ((1.0d0 / b) + t_0) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = 0.3333333333333333 * (B * x);
	double tmp;
	if (F <= -1.5e-86) {
		tmp = ((-1.0 - x) / B) + t_0;
	} else if (F <= 4.2e-69) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + t_0) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = 0.3333333333333333 * (B * x)
	tmp = 0
	if F <= -1.5e-86:
		tmp = ((-1.0 - x) / B) + t_0
	elif F <= 4.2e-69:
		tmp = -x / B
	else:
		tmp = ((1.0 / B) + t_0) - (x / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(0.3333333333333333 * Float64(B * x))
	tmp = 0.0
	if (F <= -1.5e-86)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + t_0);
	elseif (F <= 4.2e-69)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 / B) + t_0) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = 0.3333333333333333 * (B * x);
	tmp = 0.0;
	if (F <= -1.5e-86)
		tmp = ((-1.0 - x) / B) + t_0;
	elseif (F <= 4.2e-69)
		tmp = -x / B;
	else
		tmp = ((1.0 / B) + t_0) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e-86], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 4.2e-69], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{-86}:\\
\;\;\;\;\frac{-1 - x}{B} + t_0\\

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-69}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + t_0\right) - \frac{x}{B}\\


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

    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. Taylor expanded in F around -inf 72.1%

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

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

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

    if -1.5e-86 < F < 4.1999999999999999e-69

    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. Taylor expanded in F around -inf 41.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 42.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified42.4%

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

    if 4.1999999999999999e-69 < F

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-69}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\right) - \frac{x}{B}\\ \end{array} \]

Alternative 19: 44.2% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-67}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.45e-86)
   (/ (- -1.0 x) B)
   (if (<= F 2e-67)
     (/ (- x) B)
     (- (+ (/ 1.0 B) (* B 0.16666666666666666)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.45e-86) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2e-67) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.45d-86)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 2d-67) then
        tmp = -x / b
    else
        tmp = ((1.0d0 / b) + (b * 0.16666666666666666d0)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.45e-86) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2e-67) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.45e-86:
		tmp = (-1.0 - x) / B
	elif F <= 2e-67:
		tmp = -x / B
	else:
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.45e-86)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2e-67)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 / B) + Float64(B * 0.16666666666666666)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.45e-86)
		tmp = (-1.0 - x) / B;
	elseif (F <= 2e-67)
		tmp = -x / B;
	else
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-86], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2e-67], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + N[(B * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-86}:\\
\;\;\;\;\frac{-1 - x}{B}\\

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

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\


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

    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. Taylor expanded in F around -inf 89.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    7. Step-by-step derivation
      1. sub-neg45.2%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg45.2%

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      4. distribute-neg-frac45.2%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      5. metadata-eval45.2%

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

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

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

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

    if -1.45e-86 < F < 1.99999999999999989e-67

    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. Taylor expanded in F around -inf 41.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 42.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified42.4%

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

    if 1.99999999999999989e-67 < F

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

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

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

      \[\leadsto \left(\color{blue}{0.16666666666666666 \cdot B} + \frac{1}{B}\right) - \frac{x}{B} \]
    5. Step-by-step derivation
      1. *-commutative48.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-67}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \]

Alternative 20: 44.2% accurate, 21.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{-87}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -7.6e-87)
   (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x)))
   (if (<= F 3.1e-68)
     (/ (- x) B)
     (- (+ (/ 1.0 B) (* B 0.16666666666666666)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.6e-87) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 3.1e-68) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-7.6d-87)) then
        tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
    else if (f <= 3.1d-68) then
        tmp = -x / b
    else
        tmp = ((1.0d0 / b) + (b * 0.16666666666666666d0)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.6e-87) {
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	} else if (F <= 3.1e-68) {
		tmp = -x / B;
	} else {
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -7.6e-87:
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x))
	elif F <= 3.1e-68:
		tmp = -x / B
	else:
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -7.6e-87)
		tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x)));
	elseif (F <= 3.1e-68)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(Float64(1.0 / B) + Float64(B * 0.16666666666666666)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -7.6e-87)
		tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
	elseif (F <= 3.1e-68)
		tmp = -x / B;
	else
		tmp = ((1.0 / B) + (B * 0.16666666666666666)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -7.6e-87], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-68], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] + N[(B * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 3.1 \cdot 10^{-68}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\


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

    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. Taylor expanded in F around -inf 72.1%

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

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

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

    if -7.6e-87 < F < 3.0999999999999999e-68

    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. Taylor expanded in F around -inf 41.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 42.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified42.4%

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

    if 3.0999999999999999e-68 < F

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

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

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

      \[\leadsto \left(\color{blue}{0.16666666666666666 \cdot B} + \frac{1}{B}\right) - \frac{x}{B} \]
    5. Step-by-step derivation
      1. *-commutative48.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{-87}:\\ \;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\ \mathbf{elif}\;F \leq 3.1 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{B} + B \cdot 0.16666666666666666\right) - \frac{x}{B}\\ \end{array} \]

Alternative 21: 44.1% accurate, 35.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-86}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.4 \cdot 10^{-66}:\\
\;\;\;\;\frac{-x}{B}\\

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


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

    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. Taylor expanded in F around -inf 89.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    7. Step-by-step derivation
      1. sub-neg45.2%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg45.2%

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      4. distribute-neg-frac45.2%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      5. metadata-eval45.2%

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

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

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

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

    if -1.5e-86 < F < 2.40000000000000026e-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. Taylor expanded in F around -inf 41.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 42.4%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.4%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified42.4%

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

    if 2.40000000000000026e-66 < F

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-66}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 22: 30.7% accurate, 39.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-24} \lor \neg \left(x \leq 4.3 \cdot 10^{-132}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -7.2e-24) (not (<= x 4.3e-132))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -7.2e-24) || !(x <= 4.3e-132)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-7.2d-24)) .or. (.not. (x <= 4.3d-132))) then
        tmp = -x / b
    else
        tmp = (-1.0d0) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -7.2e-24) || !(x <= 4.3e-132)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -7.2e-24) or not (x <= 4.3e-132):
		tmp = -x / B
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -7.2e-24) || !(x <= 4.3e-132))
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(-1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -7.2e-24) || ~((x <= 4.3e-132)))
		tmp = -x / B;
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -7.2e-24], N[Not[LessEqual[x, 4.3e-132]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-24} \lor \neg \left(x \leq 4.3 \cdot 10^{-132}\right):\\
\;\;\;\;\frac{-x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.2000000000000002e-24 or 4.2999999999999997e-132 < x

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-147.7%

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

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

    if -7.2000000000000002e-24 < x < 4.2999999999999997e-132

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-24} \lor \neg \left(x \leq 4.3 \cdot 10^{-132}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 23: 37.0% accurate, 45.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-86}:\\
\;\;\;\;\frac{-1 - x}{B}\\

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


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

    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. Taylor expanded in F around -inf 89.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    7. Step-by-step derivation
      1. sub-neg45.2%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg45.2%

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      4. distribute-neg-frac45.2%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      5. metadata-eval45.2%

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

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

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

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

    if -1.5e-86 < F

    1. Initial program 83.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 35.5%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-135.5%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified35.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-86}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 24: 10.8% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 75.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. Taylor expanded in F around -inf 62.4%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification11.7%

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

Reproduce

?
herbie shell --seed 2023175 
(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))))))