VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.2% → 99.7%
Time: 20.5s
Alternatives: 26
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 26 alternatives:

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

Initial Program: 77.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 63.3%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
      3. associate-*l/73.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/73.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. *-commutative73.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. Simplified73.6%

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

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

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

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

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

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

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

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

    if -2e8 < F < 9500

    1. Initial program 99.5%

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

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

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

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

      \[\leadsto \left(-\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{x}{\tan B}\right)} - 1\right)}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    4. Step-by-step derivation
      1. expm1-def70.4%

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

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

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

    if 9500 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.2%

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

        \[\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. Simplified74.4%

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

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

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

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

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

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

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

      \[\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 -200000000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 9500:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 2: 99.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\frac{1}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg98.9%

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

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

    if -0.92000000000000004 < F < 1.6499999999999999

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.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/99.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. *-commutative99.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. Simplified99.6%

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

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

    if 1.6499999999999999 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.8%

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

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

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

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

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

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

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

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

Alternative 3: 99.2% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;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.92000000000000004

    1. Initial program 65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\frac{1}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg98.9%

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

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

    if -0.92000000000000004 < F < 1.3999999999999999

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.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/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

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

    if 1.3999999999999999 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.92:\\ \;\;\;\;F \cdot \frac{\frac{1}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;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 4: 92.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.165:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.092:\\ \;\;\;\;\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.165)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 0.092)
       (- (* (/ 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.165) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 0.092) {
		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.165d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 0.092d0) 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.165) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 0.092) {
		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.165:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 0.092:
		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.165)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 0.092)
		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.165)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 0.092)
		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.165], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.092], 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.165:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 0.092:\\
\;\;\;\;\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.165000000000000008

    1. Initial program 65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.165000000000000008 < F < 0.091999999999999998

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.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/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

    if 0.091999999999999998 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.165:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.092:\\ \;\;\;\;\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 5: 92.0% accurate, 1.5× speedup?

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

\mathbf{elif}\;F \leq 0.33:\\
\;\;\;\;\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.34999999999999998

    1. Initial program 65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto F \cdot \frac{\frac{1}{\color{blue}{-1 \cdot F - \frac{1}{F}}}}{\sin B} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. mul-1-neg98.9%

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

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

    if -0.34999999999999998 < F < 0.330000000000000016

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.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/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

    if 0.330000000000000016 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.35:\\ \;\;\;\;F \cdot \frac{\frac{1}{\frac{-1}{F} - F}}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.33:\\ \;\;\;\;\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 6: 85.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.0033:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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


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

    1. Initial program 69.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. +-commutative69.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-neg69.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/78.0%

        \[\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/78.0%

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000003e-47 < F < 1.8999999999999998e-99

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 1.8999999999999998e-99 < F < 0.0033

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.3%

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

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

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

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

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

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

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

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

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

    if 0.0033 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 0.0033:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 7: 91.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 0.066:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{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.429999999999999993

    1. Initial program 65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.429999999999999993 < F < 0.066000000000000003

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.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/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} - \frac{x}{\tan B} \]
      2. associate-/r/86.0%

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

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

    if 0.066000000000000003 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.8%

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

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

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

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

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

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

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

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

Alternative 8: 91.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -0.115:\\ \;\;\;\;\frac{-1}{\sin B} - t_0\\ \mathbf{elif}\;F \leq 0.34:\\ \;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - 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.115)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 0.34) (- (/ (sqrt 0.5) (/ B F)) 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.115) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 0.34) {
		tmp = (sqrt(0.5) / (B / F)) - 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.115d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 0.34d0) then
        tmp = (sqrt(0.5d0) / (b / f)) - 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.115) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 0.34) {
		tmp = (Math.sqrt(0.5) / (B / F)) - 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.115:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 0.34:
		tmp = (math.sqrt(0.5) / (B / F)) - 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.115)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 0.34)
		tmp = Float64(Float64(sqrt(0.5) / Float64(B / F)) - 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.115)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 0.34)
		tmp = (sqrt(0.5) / (B / F)) - 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.115], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.34], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[(B / F), $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.115:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\

\mathbf{elif}\;F \leq 0.34:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - 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.115000000000000005

    1. Initial program 65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.115000000000000005 < F < 0.340000000000000024

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.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/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{0.5}}{\frac{B}{F}}} - \frac{x}{\tan B} \]
    10. Simplified86.1%

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

    if 0.340000000000000024 < F

    1. Initial program 48.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. +-commutative48.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-neg48.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.8%

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

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

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

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

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

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

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

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

Alternative 9: 70.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2.25 \cdot 10^{+190}:\\ \;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - t_0\\ \mathbf{elif}\;F \leq -8.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-124}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;\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 -2.25e+190)
     (- (+ (* 0.5 (/ (* (/ x F) (/ 2.0 F)) B)) (/ -1.0 B)) t_0)
     (if (<= F -8.2e+29)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 1.25e-124)
         (/ (- (cos B)) (/ (sin B) x))
         (if (<= F 1.95) (/ (- (* 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 <= -2.25e+190) {
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	} else if (F <= -8.2e+29) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 1.25e-124) {
		tmp = -cos(B) / (sin(B) / x);
	} else if (F <= 1.95) {
		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 <= (-2.25d+190)) then
        tmp = ((0.5d0 * (((x / f) * (2.0d0 / f)) / b)) + ((-1.0d0) / b)) - t_0
    else if (f <= (-8.2d+29)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 1.25d-124) then
        tmp = -cos(b) / (sin(b) / x)
    else if (f <= 1.95d0) 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 <= -2.25e+190) {
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	} else if (F <= -8.2e+29) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 1.25e-124) {
		tmp = -Math.cos(B) / (Math.sin(B) / x);
	} else if (F <= 1.95) {
		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 <= -2.25e+190:
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0
	elif F <= -8.2e+29:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 1.25e-124:
		tmp = -math.cos(B) / (math.sin(B) / x)
	elif F <= 1.95:
		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 <= -2.25e+190)
		tmp = Float64(Float64(Float64(0.5 * Float64(Float64(Float64(x / F) * Float64(2.0 / F)) / B)) + Float64(-1.0 / B)) - t_0);
	elseif (F <= -8.2e+29)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 1.25e-124)
		tmp = Float64(Float64(-cos(B)) / Float64(sin(B) / x));
	elseif (F <= 1.95)
		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 <= -2.25e+190)
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	elseif (F <= -8.2e+29)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 1.25e-124)
		tmp = -cos(B) / (sin(B) / x);
	elseif (F <= 1.95)
		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, -2.25e+190], N[(N[(N[(0.5 * N[(N[(N[(x / F), $MachinePrecision] * N[(2.0 / F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -8.2e+29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.25e-124], N[((-N[Cos[B], $MachinePrecision]) / N[(N[Sin[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95], 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 -2.25 \cdot 10^{+190}:\\
\;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - t_0\\

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

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

\mathbf{elif}\;F \leq 1.95:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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


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

    1. Initial program 43.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. +-commutative43.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-neg43.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/57.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/57.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. *-commutative57.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. Simplified57.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 B around 0 57.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot \frac{\color{blue}{2 \cdot \frac{x}{{F}^{2}}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-*r/84.7%

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

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

        \[\leadsto \left(0.5 \cdot \frac{\frac{x \cdot 2}{\color{blue}{F \cdot F}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
      4. times-frac84.7%

        \[\leadsto \left(0.5 \cdot \frac{\color{blue}{\frac{x}{F} \cdot \frac{2}{F}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
    12. Simplified84.7%

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

    if -2.25e190 < F < -8.2000000000000007e29

    1. Initial program 74.4%

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

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

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

    if -8.2000000000000007e29 < F < 1.2500000000000001e-124

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\cos B}{\frac{\sin B}{x}}} \]
      3. distribute-neg-frac73.1%

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

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

    if 1.2500000000000001e-124 < F < 1.94999999999999996

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.4%

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

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

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

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

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

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

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

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

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

    if 1.94999999999999996 < F

    1. Initial program 48.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 69.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 41.8%

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

        \[\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-udef17.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. div-inv17.1%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/26.2%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}\right)\right)} - 1 \]
      10. metadata-eval26.2%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{{F}^{\color{blue}{0}}}{B}\right)\right)} - 1 \]
      11. metadata-eval26.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.25 \cdot 10^{+190}:\\ \;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.25 \cdot 10^{-124}:\\ \;\;\;\;\frac{-\cos B}{\frac{\sin B}{x}}\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 10: 70.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -3 \cdot 10^{+190}:\\ \;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - t_0\\ \mathbf{elif}\;F \leq -8.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-98}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;\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 -3e+190)
     (- (+ (* 0.5 (/ (* (/ x F) (/ 2.0 F)) B)) (/ -1.0 B)) t_0)
     (if (<= F -8.2e+29)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F 5e-98)
         (/ (* x (- (cos B))) (sin B))
         (if (<= F 1.95) (/ (- (* 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 <= -3e+190) {
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	} else if (F <= -8.2e+29) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 5e-98) {
		tmp = (x * -cos(B)) / sin(B);
	} else if (F <= 1.95) {
		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 <= (-3d+190)) then
        tmp = ((0.5d0 * (((x / f) * (2.0d0 / f)) / b)) + ((-1.0d0) / b)) - t_0
    else if (f <= (-8.2d+29)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 5d-98) then
        tmp = (x * -cos(b)) / sin(b)
    else if (f <= 1.95d0) 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 <= -3e+190) {
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	} else if (F <= -8.2e+29) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 5e-98) {
		tmp = (x * -Math.cos(B)) / Math.sin(B);
	} else if (F <= 1.95) {
		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 <= -3e+190:
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0
	elif F <= -8.2e+29:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 5e-98:
		tmp = (x * -math.cos(B)) / math.sin(B)
	elif F <= 1.95:
		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 <= -3e+190)
		tmp = Float64(Float64(Float64(0.5 * Float64(Float64(Float64(x / F) * Float64(2.0 / F)) / B)) + Float64(-1.0 / B)) - t_0);
	elseif (F <= -8.2e+29)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 5e-98)
		tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B));
	elseif (F <= 1.95)
		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 <= -3e+190)
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	elseif (F <= -8.2e+29)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 5e-98)
		tmp = (x * -cos(B)) / sin(B);
	elseif (F <= 1.95)
		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, -3e+190], N[(N[(N[(0.5 * N[(N[(N[(x / F), $MachinePrecision] * N[(2.0 / F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -8.2e+29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-98], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95], 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 -3 \cdot 10^{+190}:\\
\;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - t_0\\

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

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

\mathbf{elif}\;F \leq 1.95:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\

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


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

    1. Initial program 43.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. +-commutative43.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-neg43.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/57.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/57.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. *-commutative57.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. Simplified57.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 B around 0 57.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot \frac{\color{blue}{2 \cdot \frac{x}{{F}^{2}}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-*r/84.7%

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

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

        \[\leadsto \left(0.5 \cdot \frac{\frac{x \cdot 2}{\color{blue}{F \cdot F}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
      4. times-frac84.7%

        \[\leadsto \left(0.5 \cdot \frac{\color{blue}{\frac{x}{F} \cdot \frac{2}{F}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
    12. Simplified84.7%

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

    if -2.99999999999999982e190 < F < -8.2000000000000007e29

    1. Initial program 74.4%

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

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

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

    if -8.2000000000000007e29 < F < 5.00000000000000018e-98

    1. Initial program 99.5%

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

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

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

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

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

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

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

    if 5.00000000000000018e-98 < F < 1.94999999999999996

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.3%

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

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

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

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

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

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

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

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

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

    if 1.94999999999999996 < F

    1. Initial program 48.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 69.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 41.8%

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

        \[\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-udef17.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. div-inv17.1%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/26.2%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}\right)\right)} - 1 \]
      10. metadata-eval26.2%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{{F}^{\color{blue}{0}}}{B}\right)\right)} - 1 \]
      11. metadata-eval26.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+190}:\\ \;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-98}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 11: 77.7% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 1.95:\\
\;\;\;\;\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 < -9.9999999999999997e-48

    1. Initial program 69.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. +-commutative69.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-neg69.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/78.0%

        \[\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/78.0%

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999997e-48 < F < 1.5e-96

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 1.5e-96 < F < 1.94999999999999996

    1. Initial program 99.5%

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg99.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/99.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.3%

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

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

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

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

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

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

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

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

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

    if 1.94999999999999996 < F

    1. Initial program 48.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 69.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 41.8%

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

        \[\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-udef17.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. div-inv17.1%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/26.2%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}\right)\right)} - 1 \]
      10. metadata-eval26.2%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{{F}^{\color{blue}{0}}}{B}\right)\right)} - 1 \]
      11. metadata-eval26.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{-47}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-96}:\\ \;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 12: 63.8% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := F \cdot \frac{-1}{F \cdot B} - t_0\\ t_2 := \frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{if}\;F \leq -3.3 \cdot 10^{+190}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.8 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -5 \cdot 10^{-261}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - t_0\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B)))
        (t_1 (- (* F (/ -1.0 (* F B))) t_0))
        (t_2 (/ (- (* F (sqrt 0.5)) x) B)))
   (if (<= F -3.3e+190)
     t_1
     (if (<= F -1.6e+31)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -7.8e-62)
         t_1
         (if (<= F -5e-261)
           t_2
           (if (<= F 1.9e-125)
             (- (* (/ 1.0 F) (/ F B)) t_0)
             (if (<= F 1.95) t_2 (- (/ 1.0 B) t_0)))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = (F * (-1.0 / (F * B))) - t_0;
	double t_2 = ((F * sqrt(0.5)) - x) / B;
	double tmp;
	if (F <= -3.3e+190) {
		tmp = t_1;
	} else if (F <= -1.6e+31) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -7.8e-62) {
		tmp = t_1;
	} else if (F <= -5e-261) {
		tmp = t_2;
	} else if (F <= 1.9e-125) {
		tmp = ((1.0 / F) * (F / B)) - t_0;
	} else if (F <= 1.95) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = (f * ((-1.0d0) / (f * b))) - t_0
    t_2 = ((f * sqrt(0.5d0)) - x) / b
    if (f <= (-3.3d+190)) then
        tmp = t_1
    else if (f <= (-1.6d+31)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-7.8d-62)) then
        tmp = t_1
    else if (f <= (-5d-261)) then
        tmp = t_2
    else if (f <= 1.9d-125) then
        tmp = ((1.0d0 / f) * (f / b)) - t_0
    else if (f <= 1.95d0) then
        tmp = t_2
    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 t_1 = (F * (-1.0 / (F * B))) - t_0;
	double t_2 = ((F * Math.sqrt(0.5)) - x) / B;
	double tmp;
	if (F <= -3.3e+190) {
		tmp = t_1;
	} else if (F <= -1.6e+31) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -7.8e-62) {
		tmp = t_1;
	} else if (F <= -5e-261) {
		tmp = t_2;
	} else if (F <= 1.9e-125) {
		tmp = ((1.0 / F) * (F / B)) - t_0;
	} else if (F <= 1.95) {
		tmp = t_2;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = (F * (-1.0 / (F * B))) - t_0
	t_2 = ((F * math.sqrt(0.5)) - x) / B
	tmp = 0
	if F <= -3.3e+190:
		tmp = t_1
	elif F <= -1.6e+31:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -7.8e-62:
		tmp = t_1
	elif F <= -5e-261:
		tmp = t_2
	elif F <= 1.9e-125:
		tmp = ((1.0 / F) * (F / B)) - t_0
	elif F <= 1.95:
		tmp = t_2
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0)
	t_2 = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B)
	tmp = 0.0
	if (F <= -3.3e+190)
		tmp = t_1;
	elseif (F <= -1.6e+31)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -7.8e-62)
		tmp = t_1;
	elseif (F <= -5e-261)
		tmp = t_2;
	elseif (F <= 1.9e-125)
		tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / B)) - t_0);
	elseif (F <= 1.95)
		tmp = t_2;
	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);
	t_1 = (F * (-1.0 / (F * B))) - t_0;
	t_2 = ((F * sqrt(0.5)) - x) / B;
	tmp = 0.0;
	if (F <= -3.3e+190)
		tmp = t_1;
	elseif (F <= -1.6e+31)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -7.8e-62)
		tmp = t_1;
	elseif (F <= -5e-261)
		tmp = t_2;
	elseif (F <= 1.9e-125)
		tmp = ((1.0 / F) * (F / B)) - t_0;
	elseif (F <= 1.95)
		tmp = t_2;
	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]}, Block[{t$95$1 = N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -3.3e+190], t$95$1, If[LessEqual[F, -1.6e+31], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.8e-62], t$95$1, If[LessEqual[F, -5e-261], t$95$2, If[LessEqual[F, 1.9e-125], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.95], t$95$2, N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := F \cdot \frac{-1}{F \cdot B} - t_0\\
t_2 := \frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{if}\;F \leq -3.3 \cdot 10^{+190}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -1.6 \cdot 10^{+31}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -7.8 \cdot 10^{-62}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -5 \cdot 10^{-261}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;F \leq 1.9 \cdot 10^{-125}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - t_0\\

\mathbf{elif}\;F \leq 1.95:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -3.3e190 or -1.6e31 < F < -7.8000000000000007e-62

    1. Initial program 69.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. +-commutative69.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-neg69.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/76.9%

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

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

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

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

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

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

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

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

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

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

    if -3.3e190 < F < -1.6e31

    1. Initial program 74.4%

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

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

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

    if -7.8000000000000007e-62 < F < -4.99999999999999981e-261 or 1.9000000000000001e-125 < F < 1.94999999999999996

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.5%

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

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

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

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

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

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

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

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

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

    if -4.99999999999999981e-261 < F < 1.9000000000000001e-125

    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 37.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 65.5%

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

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

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

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

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

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

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

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

    if 1.94999999999999996 < F

    1. Initial program 48.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 69.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 41.8%

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

        \[\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-udef17.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. div-inv17.1%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/26.2%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}\right)\right)} - 1 \]
      10. metadata-eval26.2%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{{F}^{\color{blue}{0}}}{B}\right)\right)} - 1 \]
      11. metadata-eval26.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{+190}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.8 \cdot 10^{-62}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5 \cdot 10^{-261}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 1.9 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 13: 63.9% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := \frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{if}\;F \leq -3.3 \cdot 10^{+190}:\\ \;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - t_0\\ \mathbf{elif}\;F \leq -1.72 \cdot 10^{+30}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-62}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{-261}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{-128}:\\ \;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - t_0\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - t_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))) (t_1 (/ (- (* F (sqrt 0.5)) x) B)))
   (if (<= F -3.3e+190)
     (- (+ (* 0.5 (/ (* (/ x F) (/ 2.0 F)) B)) (/ -1.0 B)) t_0)
     (if (<= F -1.72e+30)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -6.2e-62)
         (- (* F (/ -1.0 (* F B))) t_0)
         (if (<= F -1.25e-261)
           t_1
           (if (<= F 2.05e-128)
             (- (* (/ 1.0 F) (/ F B)) t_0)
             (if (<= F 1.95) t_1 (- (/ 1.0 B) t_0)))))))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double t_1 = ((F * sqrt(0.5)) - x) / B;
	double tmp;
	if (F <= -3.3e+190) {
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	} else if (F <= -1.72e+30) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -6.2e-62) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -1.25e-261) {
		tmp = t_1;
	} else if (F <= 2.05e-128) {
		tmp = ((1.0 / F) * (F / B)) - t_0;
	} else if (F <= 1.95) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = ((f * sqrt(0.5d0)) - x) / b
    if (f <= (-3.3d+190)) then
        tmp = ((0.5d0 * (((x / f) * (2.0d0 / f)) / b)) + ((-1.0d0) / b)) - t_0
    else if (f <= (-1.72d+30)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-6.2d-62)) then
        tmp = (f * ((-1.0d0) / (f * b))) - t_0
    else if (f <= (-1.25d-261)) then
        tmp = t_1
    else if (f <= 2.05d-128) then
        tmp = ((1.0d0 / f) * (f / b)) - t_0
    else if (f <= 1.95d0) then
        tmp = t_1
    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 t_1 = ((F * Math.sqrt(0.5)) - x) / B;
	double tmp;
	if (F <= -3.3e+190) {
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	} else if (F <= -1.72e+30) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -6.2e-62) {
		tmp = (F * (-1.0 / (F * B))) - t_0;
	} else if (F <= -1.25e-261) {
		tmp = t_1;
	} else if (F <= 2.05e-128) {
		tmp = ((1.0 / F) * (F / B)) - t_0;
	} else if (F <= 1.95) {
		tmp = t_1;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	t_1 = ((F * math.sqrt(0.5)) - x) / B
	tmp = 0
	if F <= -3.3e+190:
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0
	elif F <= -1.72e+30:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -6.2e-62:
		tmp = (F * (-1.0 / (F * B))) - t_0
	elif F <= -1.25e-261:
		tmp = t_1
	elif F <= 2.05e-128:
		tmp = ((1.0 / F) * (F / B)) - t_0
	elif F <= 1.95:
		tmp = t_1
	else:
		tmp = (1.0 / B) - t_0
	return tmp
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	t_1 = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B)
	tmp = 0.0
	if (F <= -3.3e+190)
		tmp = Float64(Float64(Float64(0.5 * Float64(Float64(Float64(x / F) * Float64(2.0 / F)) / B)) + Float64(-1.0 / B)) - t_0);
	elseif (F <= -1.72e+30)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -6.2e-62)
		tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0);
	elseif (F <= -1.25e-261)
		tmp = t_1;
	elseif (F <= 2.05e-128)
		tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / B)) - t_0);
	elseif (F <= 1.95)
		tmp = t_1;
	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);
	t_1 = ((F * sqrt(0.5)) - x) / B;
	tmp = 0.0;
	if (F <= -3.3e+190)
		tmp = ((0.5 * (((x / F) * (2.0 / F)) / B)) + (-1.0 / B)) - t_0;
	elseif (F <= -1.72e+30)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -6.2e-62)
		tmp = (F * (-1.0 / (F * B))) - t_0;
	elseif (F <= -1.25e-261)
		tmp = t_1;
	elseif (F <= 2.05e-128)
		tmp = ((1.0 / F) * (F / B)) - t_0;
	elseif (F <= 1.95)
		tmp = t_1;
	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]}, Block[{t$95$1 = N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -3.3e+190], N[(N[(N[(0.5 * N[(N[(N[(x / F), $MachinePrecision] * N[(2.0 / F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.72e+30], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.2e-62], N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.25e-261], t$95$1, If[LessEqual[F, 2.05e-128], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.95], t$95$1, N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq -1.72 \cdot 10^{+30}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -6.2 \cdot 10^{-62}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot B} - t_0\\

\mathbf{elif}\;F \leq -1.25 \cdot 10^{-261}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 2.05 \cdot 10^{-128}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - t_0\\

\mathbf{elif}\;F \leq 1.95:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 43.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. +-commutative43.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-neg43.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/57.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/57.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. *-commutative57.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. Simplified57.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 B around 0 57.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot \frac{\color{blue}{2 \cdot \frac{x}{{F}^{2}}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. associate-*r/84.7%

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

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

        \[\leadsto \left(0.5 \cdot \frac{\frac{x \cdot 2}{\color{blue}{F \cdot F}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
      4. times-frac84.7%

        \[\leadsto \left(0.5 \cdot \frac{\color{blue}{\frac{x}{F} \cdot \frac{2}{F}}}{B} - \frac{1}{B}\right) - \frac{x}{\tan B} \]
    12. Simplified84.7%

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

    if -3.3e190 < F < -1.7200000000000001e30

    1. Initial program 74.4%

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

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

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

    if -1.7200000000000001e30 < F < -6.1999999999999999e-62

    1. Initial program 99.3%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.5%

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

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

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

        \[\leadsto F \cdot \left(\sqrt{\frac{1}{F \cdot F + \color{blue}{\left(2 \cdot x + 2\right)}}} \cdot \frac{1}{B}\right) - \frac{x}{\tan B} \]
      3. fma-def85.8%

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

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

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

    if -6.1999999999999999e-62 < F < -1.24999999999999995e-261 or 2.05e-128 < F < 1.94999999999999996

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.5%

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

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

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

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

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

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

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

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

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

    if -1.24999999999999995e-261 < F < 2.05e-128

    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 37.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 65.5%

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

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

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

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

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

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

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

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

    if 1.94999999999999996 < F

    1. Initial program 48.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 69.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 41.8%

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

        \[\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-udef17.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. div-inv17.1%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/26.2%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}\right)\right)} - 1 \]
      10. metadata-eval26.2%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{{F}^{\color{blue}{0}}}{B}\right)\right)} - 1 \]
      11. metadata-eval26.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.3 \cdot 10^{+190}:\\ \;\;\;\;\left(0.5 \cdot \frac{\frac{x}{F} \cdot \frac{2}{F}}{B} + \frac{-1}{B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.72 \cdot 10^{+30}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-62}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.25 \cdot 10^{-261}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{-128}:\\ \;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 14: 63.3% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{if}\;F \leq -2.6 \cdot 10^{+190}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq -1.8 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-62}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-282} \lor \neg \left(F \leq 9 \cdot 10^{-126}\right) \land F \leq 1.95:\\ \;\;\;\;\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
 (let* ((t_0 (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))))
   (if (<= F -2.6e+190)
     t_0
     (if (<= F -1.8e+31)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -4.5e-62)
         t_0
         (if (or (<= F 1.3e-282) (and (not (<= F 9e-126)) (<= F 1.95)))
           (/ (- (* F (sqrt 0.5)) x) B)
           (- (/ 1.0 B) (/ x (tan B)))))))))
double code(double F, double B, double x) {
	double t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	double tmp;
	if (F <= -2.6e+190) {
		tmp = t_0;
	} else if (F <= -1.8e+31) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -4.5e-62) {
		tmp = t_0;
	} else if ((F <= 1.3e-282) || (!(F <= 9e-126) && (F <= 1.95))) {
		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) :: t_0
    real(8) :: tmp
    t_0 = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
    if (f <= (-2.6d+190)) then
        tmp = t_0
    else if (f <= (-1.8d+31)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-4.5d-62)) then
        tmp = t_0
    else if ((f <= 1.3d-282) .or. (.not. (f <= 9d-126)) .and. (f <= 1.95d0)) 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 t_0 = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
	double tmp;
	if (F <= -2.6e+190) {
		tmp = t_0;
	} else if (F <= -1.8e+31) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -4.5e-62) {
		tmp = t_0;
	} else if ((F <= 1.3e-282) || (!(F <= 9e-126) && (F <= 1.95))) {
		tmp = ((F * Math.sqrt(0.5)) - x) / B;
	} else {
		tmp = (1.0 / B) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (x * (-1.0 / math.tan(B))) + (-1.0 / B)
	tmp = 0
	if F <= -2.6e+190:
		tmp = t_0
	elif F <= -1.8e+31:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -4.5e-62:
		tmp = t_0
	elif (F <= 1.3e-282) or (not (F <= 9e-126) and (F <= 1.95)):
		tmp = ((F * math.sqrt(0.5)) - x) / B
	else:
		tmp = (1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B))
	tmp = 0.0
	if (F <= -2.6e+190)
		tmp = t_0;
	elseif (F <= -1.8e+31)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -4.5e-62)
		tmp = t_0;
	elseif ((F <= 1.3e-282) || (!(F <= 9e-126) && (F <= 1.95)))
		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)
	t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B);
	tmp = 0.0;
	if (F <= -2.6e+190)
		tmp = t_0;
	elseif (F <= -1.8e+31)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -4.5e-62)
		tmp = t_0;
	elseif ((F <= 1.3e-282) || (~((F <= 9e-126)) && (F <= 1.95)))
		tmp = ((F * sqrt(0.5)) - x) / B;
	else
		tmp = (1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.6e+190], t$95$0, If[LessEqual[F, -1.8e+31], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.5e-62], t$95$0, If[Or[LessEqual[F, 1.3e-282], And[N[Not[LessEqual[F, 9e-126]], $MachinePrecision], LessEqual[F, 1.95]]], 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}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{if}\;F \leq -2.6 \cdot 10^{+190}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq -4.5 \cdot 10^{-62}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 1.3 \cdot 10^{-282} \lor \neg \left(F \leq 9 \cdot 10^{-126}\right) \land F \leq 1.95:\\
\;\;\;\;\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 < -2.60000000000000011e190 or -1.79999999999999998e31 < F < -4.50000000000000018e-62

    1. Initial program 69.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 82.3%

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

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

    if -2.60000000000000011e190 < F < -1.79999999999999998e31

    1. Initial program 74.4%

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

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

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

    if -4.50000000000000018e-62 < F < 1.30000000000000006e-282 or 9.0000000000000005e-126 < F < 1.94999999999999996

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

    if 1.30000000000000006e-282 < F < 9.0000000000000005e-126 or 1.94999999999999996 < F

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

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

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

        \[\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-udef18.8%

        \[\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. div-inv18.8%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/25.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{+190}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -1.8 \cdot 10^{+31}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -4.5 \cdot 10^{-62}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-282} \lor \neg \left(F \leq 9 \cdot 10^{-126}\right) \land F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 15: 63.2% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ t_1 := F \cdot \frac{-1}{F \cdot B} - t_0\\ \mathbf{if}\;F \leq -3.2 \cdot 10^{+190}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{+29}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.4 \cdot 10^{-62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-285} \lor \neg \left(F \leq 6 \cdot 10^{-126}\right) \land F \leq 1.95:\\ \;\;\;\;\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))) (t_1 (- (* F (/ -1.0 (* F B))) t_0)))
   (if (<= F -3.2e+190)
     t_1
     (if (<= F -8.4e+29)
       (- (/ -1.0 (sin B)) (/ x B))
       (if (<= F -5.4e-62)
         t_1
         (if (or (<= F 3.3e-285) (and (not (<= F 6e-126)) (<= F 1.95)))
           (/ (- (* 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 t_1 = (F * (-1.0 / (F * B))) - t_0;
	double tmp;
	if (F <= -3.2e+190) {
		tmp = t_1;
	} else if (F <= -8.4e+29) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= -5.4e-62) {
		tmp = t_1;
	} else if ((F <= 3.3e-285) || (!(F <= 6e-126) && (F <= 1.95))) {
		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) :: t_1
    real(8) :: tmp
    t_0 = x / tan(b)
    t_1 = (f * ((-1.0d0) / (f * b))) - t_0
    if (f <= (-3.2d+190)) then
        tmp = t_1
    else if (f <= (-8.4d+29)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= (-5.4d-62)) then
        tmp = t_1
    else if ((f <= 3.3d-285) .or. (.not. (f <= 6d-126)) .and. (f <= 1.95d0)) 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 t_1 = (F * (-1.0 / (F * B))) - t_0;
	double tmp;
	if (F <= -3.2e+190) {
		tmp = t_1;
	} else if (F <= -8.4e+29) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= -5.4e-62) {
		tmp = t_1;
	} else if ((F <= 3.3e-285) || (!(F <= 6e-126) && (F <= 1.95))) {
		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)
	t_1 = (F * (-1.0 / (F * B))) - t_0
	tmp = 0
	if F <= -3.2e+190:
		tmp = t_1
	elif F <= -8.4e+29:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= -5.4e-62:
		tmp = t_1
	elif (F <= 3.3e-285) or (not (F <= 6e-126) and (F <= 1.95)):
		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))
	t_1 = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0)
	tmp = 0.0
	if (F <= -3.2e+190)
		tmp = t_1;
	elseif (F <= -8.4e+29)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= -5.4e-62)
		tmp = t_1;
	elseif ((F <= 3.3e-285) || (!(F <= 6e-126) && (F <= 1.95)))
		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);
	t_1 = (F * (-1.0 / (F * B))) - t_0;
	tmp = 0.0;
	if (F <= -3.2e+190)
		tmp = t_1;
	elseif (F <= -8.4e+29)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= -5.4e-62)
		tmp = t_1;
	elseif ((F <= 3.3e-285) || (~((F <= 6e-126)) && (F <= 1.95)))
		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]}, Block[{t$95$1 = N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -3.2e+190], t$95$1, If[LessEqual[F, -8.4e+29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.4e-62], t$95$1, If[Or[LessEqual[F, 3.3e-285], And[N[Not[LessEqual[F, 6e-126]], $MachinePrecision], LessEqual[F, 1.95]]], 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}\\
t_1 := F \cdot \frac{-1}{F \cdot B} - t_0\\
\mathbf{if}\;F \leq -3.2 \cdot 10^{+190}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq -8.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -5.4 \cdot 10^{-62}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;F \leq 3.3 \cdot 10^{-285} \lor \neg \left(F \leq 6 \cdot 10^{-126}\right) \land F \leq 1.95:\\
\;\;\;\;\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 < -3.2000000000000001e190 or -8.4000000000000006e29 < F < -5.40000000000000039e-62

    1. Initial program 69.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. +-commutative69.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-neg69.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/76.9%

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e190 < F < -8.4000000000000006e29

    1. Initial program 74.4%

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

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

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

    if -5.40000000000000039e-62 < F < 3.29999999999999985e-285 or 6.0000000000000003e-126 < F < 1.94999999999999996

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

    if 3.29999999999999985e-285 < F < 6.0000000000000003e-126 or 1.94999999999999996 < F

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

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

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

        \[\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-udef18.8%

        \[\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. div-inv18.8%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/25.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.2 \cdot 10^{+190}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -8.4 \cdot 10^{+29}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5.4 \cdot 10^{-62}:\\ \;\;\;\;F \cdot \frac{-1}{F \cdot B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-285} \lor \neg \left(F \leq 6 \cdot 10^{-126}\right) \land F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 16: 63.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.27:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-279} \lor \neg \left(F \leq 1.95 \cdot 10^{-128}\right) \land F \leq 1.95:\\ \;\;\;\;\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 -0.27)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F 1.2e-279) (and (not (<= F 1.95e-128)) (<= F 1.95)))
     (/ (- (* F (sqrt 0.5)) x) B)
     (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.27) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= 1.2e-279) || (!(F <= 1.95e-128) && (F <= 1.95))) {
		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 <= (-0.27d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= 1.2d-279) .or. (.not. (f <= 1.95d-128)) .and. (f <= 1.95d0)) 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 <= -0.27) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= 1.2e-279) || (!(F <= 1.95e-128) && (F <= 1.95))) {
		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 <= -0.27:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= 1.2e-279) or (not (F <= 1.95e-128) and (F <= 1.95)):
		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 <= -0.27)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= 1.2e-279) || (!(F <= 1.95e-128) && (F <= 1.95)))
		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 <= -0.27)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= 1.2e-279) || (~((F <= 1.95e-128)) && (F <= 1.95)))
		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, -0.27], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.2e-279], And[N[Not[LessEqual[F, 1.95e-128]], $MachinePrecision], LessEqual[F, 1.95]]], 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 -0.27:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.2 \cdot 10^{-279} \lor \neg \left(F \leq 1.95 \cdot 10^{-128}\right) \land F \leq 1.95:\\
\;\;\;\;\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 3 regimes
  2. if F < -0.27000000000000002

    1. Initial program 65.4%

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

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

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

    if -0.27000000000000002 < F < 1.19999999999999995e-279 or 1.94999999999999998e-128 < F < 1.94999999999999996

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      4. associate-*r/99.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. *-commutative99.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. Simplified99.6%

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

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

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

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

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

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

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

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

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

    if 1.19999999999999995e-279 < F < 1.94999999999999998e-128 or 1.94999999999999996 < F

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

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

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

        \[\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-udef18.8%

        \[\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. div-inv18.8%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/25.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.27:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-279} \lor \neg \left(F \leq 1.95 \cdot 10^{-128}\right) \land F \leq 1.95:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 17: 56.0% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{-16} \lor \neg \left(x \leq 6 \cdot 10^{-156}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -1.65e-16) (not (<= x 6e-156)))
   (- (/ 1.0 B) (/ x (tan B)))
   (+ (/ -1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.65e-16) || !(x <= 6e-156)) {
		tmp = (1.0 / B) - (x / tan(B));
	} else {
		tmp = (-1.0 / sin(B)) + (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-1.65d-16)) .or. (.not. (x <= 6d-156))) then
        tmp = (1.0d0 / b) - (x / tan(b))
    else
        tmp = ((-1.0d0) / sin(b)) + (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.65e-16) || !(x <= 6e-156)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = (-1.0 / Math.sin(B)) + (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -1.65e-16) or not (x <= 6e-156):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = (-1.0 / math.sin(B)) + (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -1.65e-16) || !(x <= 6e-156))
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(-1.0 / sin(B)) + Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -1.65e-16) || ~((x <= 6e-156)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = (-1.0 / sin(B)) + (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.65e-16], N[Not[LessEqual[x, 6e-156]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-16} \lor \neg \left(x \leq 6 \cdot 10^{-156}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.64999999999999994e-16 or 6e-156 < x

    1. Initial program 79.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 66.6%

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

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

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

        \[\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. div-inv33.5%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/38.7%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}\right)\right)} - 1 \]
      10. metadata-eval38.7%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{{F}^{\color{blue}{0}}}{B}\right)\right)} - 1 \]
      11. metadata-eval38.7%

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

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

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

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

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

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

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

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

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

    if -1.64999999999999994e-16 < x < 6e-156

    1. Initial program 72.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 30.6%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. add-sqr-sqrt4.0%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\sqrt{\color{blue}{\frac{x}{B} \cdot \frac{x}{B}}} + \frac{-1}{\sin B}\right)} - 1 \]
      6. sqrt-unprod11.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{x}{B}} \cdot \sqrt{\frac{x}{B}}} + \frac{-1}{\sin B}\right)} - 1 \]
      7. add-sqr-sqrt14.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{B}} + \frac{-1}{\sin B}\right)} - 1 \]
    5. Applied egg-rr14.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x}{B} + \frac{-1}{\sin B}\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def14.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{-16} \lor \neg \left(x \leq 6 \cdot 10^{-156}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{x}{B}\\ \end{array} \]

Alternative 18: 57.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-33} \lor \neg \left(x \leq 2.35 \cdot 10^{-175}\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 (<= x -2.1e-33) (not (<= x 2.35e-175)))
   (- (/ 1.0 B) (/ x (tan B)))
   (/ (- (* F (sqrt 0.5)) x) B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.1e-33) || !(x <= 2.35e-175)) {
		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 ((x <= (-2.1d-33)) .or. (.not. (x <= 2.35d-175))) 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 ((x <= -2.1e-33) || !(x <= 2.35e-175)) {
		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 (x <= -2.1e-33) or not (x <= 2.35e-175):
		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 ((x <= -2.1e-33) || !(x <= 2.35e-175))
		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 ((x <= -2.1e-33) || ~((x <= 2.35e-175)))
		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[x, -2.1e-33], N[Not[LessEqual[x, 2.35e-175]], $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}\;x \leq -2.1 \cdot 10^{-33} \lor \neg \left(x \leq 2.35 \cdot 10^{-175}\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 x < -2.1e-33 or 2.34999999999999999e-175 < x

    1. Initial program 79.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 62.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 67.4%

      \[\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-u38.4%

        \[\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-udef31.4%

        \[\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. div-inv31.4%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{F}{B} \cdot \frac{1}{F}\right)}\right)} - 1 \]
      6. associate-*l/36.3%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{\color{blue}{{F}^{\left(1 + -1\right)}}}{B}\right)\right)} - 1 \]
      10. metadata-eval36.3%

        \[\leadsto e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, \frac{x}{\tan B}, \frac{{F}^{\color{blue}{0}}}{B}\right)\right)} - 1 \]
      11. metadata-eval36.3%

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

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

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

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

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

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

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

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

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

    if -2.1e-33 < x < 2.34999999999999999e-175

    1. Initial program 72.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. +-commutative72.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-neg72.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/74.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/74.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. *-commutative74.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. Simplified74.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 x around 0 74.2%

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

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

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

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

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

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

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

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

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

Alternative 19: 43.4% accurate, 3.0× speedup?

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

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

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

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


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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\right)} - 1} \]
      3. add-sqr-sqrt13.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{-\frac{x}{B}} \cdot \sqrt{-\frac{x}{B}}} + \frac{-1}{\sin B}\right)} - 1 \]
      4. sqrt-unprod30.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\left(-\frac{x}{B}\right) \cdot \left(-\frac{x}{B}\right)}} + \frac{-1}{\sin B}\right)} - 1 \]
      5. sqr-neg30.0%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\frac{x}{B}} \cdot \sqrt{\frac{x}{B}}} + \frac{-1}{\sin B}\right)} - 1 \]
      7. add-sqr-sqrt26.1%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{B}} + \frac{-1}{\sin B}\right)} - 1 \]
    5. Applied egg-rr26.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x}{B} + \frac{-1}{\sin B}\right)} - 1} \]
    6. Step-by-step derivation
      1. expm1-def26.2%

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

        \[\leadsto \color{blue}{\frac{x}{B} + \frac{-1}{\sin B}} \]
      3. +-commutative57.8%

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

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

    if -1.60000000000000014e26 < F < 4.8e-102

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.8e-102 < F

    1. Initial program 62.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 60.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 42.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{\sin B} + \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{-102}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\ \end{array} \]

Alternative 20: 43.6% accurate, 21.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0105:\\
\;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\

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

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


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

    1. Initial program 65.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 97.6%

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

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

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

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

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot B - \frac{1 + x}{B}} \]
      4. *-commutative47.2%

        \[\leadsto \color{blue}{B \cdot -0.16666666666666666} - \frac{1 + x}{B} \]
    6. Simplified47.2%

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

    if -0.0105000000000000007 < F < 1.89999999999999999e-100

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified41.3%

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

    if 1.89999999999999999e-100 < F

    1. Initial program 62.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 60.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 42.5%

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

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

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

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

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

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

Alternative 21: 43.5% accurate, 21.4× speedup?

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

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

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

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


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

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

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

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

    if -8.1999999999999994e-67 < F < 2.29999999999999994e-100

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999994e-100 < F

    1. Initial program 62.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 60.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 42.5%

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

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

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

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

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

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

Alternative 22: 43.5% accurate, 29.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0105:\\
\;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\

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

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


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

    1. Initial program 65.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 97.6%

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

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

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

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

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot B - \frac{1 + x}{B}} \]
      4. *-commutative47.2%

        \[\leadsto \color{blue}{B \cdot -0.16666666666666666} - \frac{1 + x}{B} \]
    6. Simplified47.2%

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

    if -0.0105000000000000007 < F < 2.19999999999999989e-100

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified21.0%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 41.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/41.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-141.3%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified41.3%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.19999999999999989e-100 < F

    1. Initial program 62.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 60.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 42.5%

      \[\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 48.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.0105:\\ \;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-100}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 23: 29.4% accurate, 31.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{+232} \lor \neg \left(F \leq -2 \cdot 10^{+188}\right) \land F \leq -2.6 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= F -7.6e+232) (and (not (<= F -2e+188)) (<= F -2.6e+26)))
   (/ -1.0 B)
   (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if ((F <= -7.6e+232) || (!(F <= -2e+188) && (F <= -2.6e+26))) {
		tmp = -1.0 / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((f <= (-7.6d+232)) .or. (.not. (f <= (-2d+188))) .and. (f <= (-2.6d+26))) then
        tmp = (-1.0d0) / b
    else
        tmp = -x / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((F <= -7.6e+232) || (!(F <= -2e+188) && (F <= -2.6e+26))) {
		tmp = -1.0 / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (F <= -7.6e+232) or (not (F <= -2e+188) and (F <= -2.6e+26)):
		tmp = -1.0 / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((F <= -7.6e+232) || (!(F <= -2e+188) && (F <= -2.6e+26)))
		tmp = Float64(-1.0 / B);
	else
		tmp = Float64(Float64(-x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((F <= -7.6e+232) || (~((F <= -2e+188)) && (F <= -2.6e+26)))
		tmp = -1.0 / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[F, -7.6e+232], And[N[Not[LessEqual[F, -2e+188]], $MachinePrecision], LessEqual[F, -2.6e+26]]], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.6 \cdot 10^{+232} \lor \neg \left(F \leq -2 \cdot 10^{+188}\right) \land F \leq -2.6 \cdot 10^{+26}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -7.6000000000000002e232 or -2e188 < F < -2.60000000000000002e26

    1. Initial program 64.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 99.6%

      \[\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}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/48.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in48.5%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval48.5%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-148.5%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified48.5%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around 0 37.5%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]

    if -7.6000000000000002e232 < F < -2e188 or -2.60000000000000002e26 < F

    1. Initial program 79.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 44.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 27.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/27.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in27.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval27.9%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-127.9%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified27.9%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 37.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/37.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-137.1%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified37.1%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{+232} \lor \neg \left(F \leq -2 \cdot 10^{+188}\right) \land F \leq -2.6 \cdot 10^{+26}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 24: 43.4% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.52 \cdot 10^{-63}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-100}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.52e-63)
   (/ (- -1.0 x) B)
   (if (<= F 2.3e-100) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.52e-63) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.3e-100) {
		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.52d-63)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 2.3d-100) 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.52e-63) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 2.3e-100) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.52e-63:
		tmp = (-1.0 - x) / B
	elif F <= 2.3e-100:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.52e-63)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 2.3e-100)
		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.52e-63)
		tmp = (-1.0 - x) / B;
	elseif (F <= 2.3e-100)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.52e-63], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-100], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.52 \cdot 10^{-63}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-100}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.5200000000000001e-63

    1. Initial program 71.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 88.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 43.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/43.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in43.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval43.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-143.4%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified43.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around 0 43.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    7. Step-by-step derivation
      1. sub-neg43.4%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg43.4%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \left(-\frac{1}{B}\right) \]
      3. +-commutative43.4%

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      4. distribute-neg-frac43.4%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      5. metadata-eval43.4%

        \[\leadsto \frac{\color{blue}{-1}}{B} + \left(-\frac{x}{B}\right) \]
      6. sub-neg43.4%

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub43.4%

        \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]
    8. Simplified43.4%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -1.5200000000000001e-63 < F < 2.29999999999999994e-100

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 31.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 19.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/19.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in19.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval19.3%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-119.3%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified19.3%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 43.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/43.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-143.6%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified43.6%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 2.29999999999999994e-100 < F

    1. Initial program 62.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 60.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 42.5%

      \[\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 48.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.52 \cdot 10^{-63}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2.3 \cdot 10^{-100}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 25: 36.0% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.36 \cdot 10^{-62}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.36e-62) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.36e-62) {
		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.36d-62)) 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.36e-62) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = -x / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.36e-62:
		tmp = (-1.0 - x) / B
	else:
		tmp = -x / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.36e-62)
		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.36e-62)
		tmp = (-1.0 - x) / B;
	else
		tmp = -x / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.36e-62], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.36 \cdot 10^{-62}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -1.35999999999999999e-62

    1. Initial program 71.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 88.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 43.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/43.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in43.4%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval43.4%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-143.4%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified43.4%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around 0 43.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} - \frac{1}{B}} \]
    7. Step-by-step derivation
      1. sub-neg43.4%

        \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \left(-\frac{1}{B}\right)} \]
      2. mul-1-neg43.4%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \left(-\frac{1}{B}\right) \]
      3. +-commutative43.4%

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) + \left(-\frac{x}{B}\right)} \]
      4. distribute-neg-frac43.4%

        \[\leadsto \color{blue}{\frac{-1}{B}} + \left(-\frac{x}{B}\right) \]
      5. metadata-eval43.4%

        \[\leadsto \frac{\color{blue}{-1}}{B} + \left(-\frac{x}{B}\right) \]
      6. sub-neg43.4%

        \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{B}} \]
      7. div-sub43.4%

        \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]
    8. Simplified43.4%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -1.35999999999999999e-62 < F

    1. Initial program 79.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in F around -inf 38.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Taylor expanded in B around 0 26.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    4. Step-by-step derivation
      1. associate-*r/26.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in26.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval26.3%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-126.3%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
    5. Simplified26.3%

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 37.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    7. Step-by-step derivation
      1. associate-*r/37.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-137.8%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified37.8%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.36 \cdot 10^{-62}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \]

Alternative 26: 9.9% 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 76.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 55.9%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
  3. Taylor expanded in B around 0 32.1%

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  4. Step-by-step derivation
    1. associate-*r/32.1%

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in32.1%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval32.1%

      \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
    4. neg-mul-132.1%

      \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
  5. Simplified32.1%

    \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
  6. Taylor expanded in x around 0 10.9%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification10.9%

    \[\leadsto \frac{-1}{B} \]

Reproduce

?
herbie shell --seed 2023258 
(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))))))