VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.7% → 99.6%
Time: 31.1s
Alternatives: 29
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 29 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

    if -1.5e8 < F < 2.1e6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e6 < F

    1. Initial program 51.6%

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

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

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

Alternative 2: 99.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;F \leq 20000000000000:\\
\;\;\;\;t_0 + \frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\

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


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

    1. Initial program 53.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 77.0%

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

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

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

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

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

    if -9.9999999999999999e51 < F < 2e13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e13 < F

    1. Initial program 49.6%

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

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

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

Alternative 3: 99.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 53.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 77.0%

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

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

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

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

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

    if -9.9999999999999999e51 < F < 1.35e13

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

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

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

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

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

    if 1.35e13 < F

    1. Initial program 49.6%

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

    if -9.5e7 < F < 1.35e13

    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. clear-num99.5%

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

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

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

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

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

    if 1.35e13 < F

    1. Initial program 49.6%

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

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

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

Alternative 5: 99.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 53.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 77.0%

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

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

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

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

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

    if -1.14999999999999997e54 < F < 2.1e6

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

    if 2.1e6 < F

    1. Initial program 51.6%

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

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

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

Alternative 6: 98.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

    if -1.3999999999999999 < F < 2.29999999999999995e-7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999995e-7 < F

    1. Initial program 52.9%

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

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

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

Alternative 7: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-7}:\\
\;\;\;\;t_0 + \frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}}\\

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


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

    1. Initial program 57.6%

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

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

    if -1.3999999999999999 < F < 2.29999999999999995e-7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999995e-7 < F

    1. Initial program 52.9%

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

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

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

Alternative 8: 98.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 2.3 \cdot 10^{-7}:\\
\;\;\;\;t_0 + \frac{\frac{F}{\sin B}}{\sqrt{2 + x \cdot 2}}\\

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


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

    1. Initial program 57.6%

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

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

    if -1.3999999999999999 < F < 2.29999999999999995e-7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999995e-7 < F

    1. Initial program 52.9%

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

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

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

Alternative 9: 90.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -3 \cdot 10^{-189}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;F \leq 1100000:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 53.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 77.0%

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

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

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

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

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

    if -2.1000000000000001e51 < F < -3e-189 or 1.14999999999999993e-123 < F < 1.1e6

    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 B around 0 83.2%

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

    if -3e-189 < F < 1.14999999999999993e-123

    1. Initial program 99.5%

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

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

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

    if 1.1e6 < F

    1. Initial program 51.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.1 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} - \frac{F}{F \cdot \sin B}\\ \mathbf{elif}\;F \leq -3 \cdot 10^{-189}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.15 \cdot 10^{-123}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B}\\ \mathbf{elif}\;F \leq 1100000:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 10: 91.2% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

    if -0.0550000000000000003 < F < 3.8000000000000002e-14

    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 B around 0 74.5%

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

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

    if 3.8000000000000002e-14 < F

    1. Initial program 54.1%

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

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

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

Alternative 11: 84.1% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 57.6%

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

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

    if -9.5000000000000005e-15 < F < -1.6e-131

    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. Taylor expanded in B around 0 64.5%

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

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

    if -1.6e-131 < F < 3.19999999999999982e-66

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999982e-66 < F

    1. Initial program 58.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-131}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-66}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{B}}{\frac{-1 - x}{F} - F}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 12: 74.8% accurate, 1.5× speedup?

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

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

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

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

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

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


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

    1. Initial program 57.6%

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

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

    if -5.00000000000000024e-5 < F < -1.6e-131

    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. Taylor expanded in B around 0 64.5%

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

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

    if -1.6e-131 < F < 6.20000000000000004e-71

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.20000000000000004e-71 < F < 4.50000000000000002e247

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse64.5%

        \[\leadsto \frac{\color{blue}{1}}{B} - x \cdot \frac{1}{\tan B} \]
      5. un-div-inv64.5%

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

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

    if 4.50000000000000002e247 < F

    1. Initial program 26.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 93.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-131}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-71}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{B}}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{+247}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 13: 67.6% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \leq -3.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{t_0}{t_1} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 6.2 \cdot 10^{-71}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{B}}{t_1}\\

\mathbf{elif}\;F \leq 5 \cdot 10^{+247}:\\
\;\;\;\;\frac{1}{B} - t_2\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{F}} \cdot \sqrt{\frac{-1}{F}}\right)} \cdot \frac{F}{B} \]
      9. add-sqr-sqrt54.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{F}} \cdot \frac{F}{B} \]
      10. div-inv54.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-1 \cdot \frac{1}{F}\right)} \cdot \frac{F}{B} \]
      11. mul-1-neg54.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-\frac{1}{F}\right)} \cdot \frac{F}{B} \]
      12. cancel-sign-sub-inv54.5%

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \frac{1}{\tan B}\right)} - \frac{1}{F} \cdot \frac{F}{B} \]
      14. *-commutative54.5%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F}{B} \cdot \frac{1}{F}} \]
      15. fma-neg54.5%

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

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

        \[\leadsto \mathsf{fma}\left(-1, \frac{x}{\tan B}, -\color{blue}{\frac{F \cdot \frac{1}{F}}{B}}\right) \]
      18. rgt-mult-inverse77.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999999e54 < F < -3.2e-30

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2e-30 < F < 6.20000000000000004e-71

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.20000000000000004e-71 < F < 5.00000000000000023e247

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse64.5%

        \[\leadsto \frac{\color{blue}{1}}{B} - x \cdot \frac{1}{\tan B} \]
      5. un-div-inv64.5%

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

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

    if 5.00000000000000023e247 < F

    1. Initial program 26.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 93.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{+54}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\frac{-1 - x}{F} - F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-71}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{B}}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+247}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 14: 68.0% accurate, 2.6× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 5 \cdot 10^{+247}:\\
\;\;\;\;\frac{1}{B} - t_0\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{F}} \cdot \sqrt{\frac{-1}{F}}\right)} \cdot \frac{F}{B} \]
      9. add-sqr-sqrt53.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{F}} \cdot \frac{F}{B} \]
      10. div-inv53.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-1 \cdot \frac{1}{F}\right)} \cdot \frac{F}{B} \]
      11. mul-1-neg53.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-\frac{1}{F}\right)} \cdot \frac{F}{B} \]
      12. cancel-sign-sub-inv53.0%

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \frac{1}{\tan B}\right)} - \frac{1}{F} \cdot \frac{F}{B} \]
      14. *-commutative53.0%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F}{B} \cdot \frac{1}{F}} \]
      15. fma-neg53.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, x \cdot \frac{1}{\tan B}, -\frac{F}{B} \cdot \frac{1}{F}\right)} \]
      16. un-div-inv53.0%

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

        \[\leadsto \mathsf{fma}\left(-1, \frac{x}{\tan B}, -\color{blue}{\frac{F \cdot \frac{1}{F}}{B}}\right) \]
      18. rgt-mult-inverse73.8%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\tan B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in73.8%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) - \frac{x}{\tan B}} \]
      7. distribute-neg-frac73.8%

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

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

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

    if -7.6000000000000004e-14 < F < -1.6e-131

    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. Taylor expanded in B around 0 64.5%

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

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

    if -1.6e-131 < F < 3.3000000000000002e-71

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.3000000000000002e-71 < F < 5.00000000000000023e247

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse64.5%

        \[\leadsto \frac{\color{blue}{1}}{B} - x \cdot \frac{1}{\tan B} \]
      5. un-div-inv64.5%

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

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

    if 5.00000000000000023e247 < F

    1. Initial program 26.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 93.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{-14}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1.6 \cdot 10^{-131}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.3 \cdot 10^{-71}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{B}}{\frac{-1 - x}{F} - F}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+247}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 15: 58.8% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;F \leq -2.95 \cdot 10^{-84}:\\
\;\;\;\;\frac{t_0}{\frac{-1 - x}{F} - F} - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq 4.8 \cdot 10^{+247}:\\
\;\;\;\;\frac{1}{B} - t_1\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{F}} \cdot \sqrt{\frac{-1}{F}}\right)} \cdot \frac{F}{B} \]
      9. add-sqr-sqrt54.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{F}} \cdot \frac{F}{B} \]
      10. div-inv54.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-1 \cdot \frac{1}{F}\right)} \cdot \frac{F}{B} \]
      11. mul-1-neg54.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-\frac{1}{F}\right)} \cdot \frac{F}{B} \]
      12. cancel-sign-sub-inv54.5%

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \frac{1}{\tan B}\right)} - \frac{1}{F} \cdot \frac{F}{B} \]
      14. *-commutative54.5%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F}{B} \cdot \frac{1}{F}} \]
      15. fma-neg54.5%

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

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

        \[\leadsto \mathsf{fma}\left(-1, \frac{x}{\tan B}, -\color{blue}{\frac{F \cdot \frac{1}{F}}{B}}\right) \]
      18. rgt-mult-inverse77.2%

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

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

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

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

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

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

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

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

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

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

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

    if -9.19999999999999977e54 < F < -2.94999999999999992e-84

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.94999999999999992e-84 < F < 1.9999999999999999e-77

    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 B around 0 79.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{F} \cdot \color{blue}{\frac{1}{\frac{B}{F}}} \]
      3. un-div-inv48.8%

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

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

    if 1.9999999999999999e-77 < F < 4.8e247

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse64.5%

        \[\leadsto \frac{\color{blue}{1}}{B} - x \cdot \frac{1}{\tan B} \]
      5. un-div-inv64.5%

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

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

    if 4.8e247 < F

    1. Initial program 26.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 93.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.2 \cdot 10^{+54}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.95 \cdot 10^{-84}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\frac{-1 - x}{F} - F} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-77}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{+247}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 16: 59.5% accurate, 2.8× speedup?

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

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

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

\mathbf{elif}\;F \leq 5 \cdot 10^{+247}:\\
\;\;\;\;\frac{1}{B} - t_0\\

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{F}} \cdot \sqrt{\frac{-1}{F}}\right)} \cdot \frac{F}{B} \]
      9. add-sqr-sqrt44.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{F}} \cdot \frac{F}{B} \]
      10. div-inv44.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-1 \cdot \frac{1}{F}\right)} \cdot \frac{F}{B} \]
      11. mul-1-neg44.0%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-\frac{1}{F}\right)} \cdot \frac{F}{B} \]
      12. cancel-sign-sub-inv44.0%

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \frac{1}{\tan B}\right)} - \frac{1}{F} \cdot \frac{F}{B} \]
      14. *-commutative44.0%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F}{B} \cdot \frac{1}{F}} \]
      15. fma-neg44.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, x \cdot \frac{1}{\tan B}, -\frac{F}{B} \cdot \frac{1}{F}\right)} \]
      16. un-div-inv44.0%

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

        \[\leadsto \mathsf{fma}\left(-1, \frac{x}{\tan B}, -\color{blue}{\frac{F \cdot \frac{1}{F}}{B}}\right) \]
      18. rgt-mult-inverse56.7%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\tan B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in56.7%

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

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

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

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

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

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

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

    if -2.3999999999999999e-256 < F < 9.9999999999999996e-76

    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 B around 0 81.8%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{F} \cdot \color{blue}{\frac{1}{\frac{B}{F}}} \]
      3. un-div-inv57.0%

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

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

    if 9.9999999999999996e-76 < F < 5.00000000000000023e247

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse64.5%

        \[\leadsto \frac{\color{blue}{1}}{B} - x \cdot \frac{1}{\tan B} \]
      5. un-div-inv64.5%

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

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

    if 5.00000000000000023e247 < F

    1. Initial program 26.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 93.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{-256}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 10^{-75}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{1}{F}}{\frac{B}{F}}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+247}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 17: 58.6% accurate, 2.8× speedup?

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

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

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

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


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

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

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

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{B} \]
      2. clear-num56.7%

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

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

    if 5.49999999999999985e-265 < F < 4.8e247

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse58.3%

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

        \[\leadsto \frac{1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    5. Applied egg-rr58.3%

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

    if 4.8e247 < F

    1. Initial program 26.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 93.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 5.5 \cdot 10^{-265}:\\ \;\;\;\;\frac{-1}{B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{elif}\;F \leq 4.8 \cdot 10^{+247}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\ \end{array} \]

Alternative 18: 61.3% accurate, 2.9× speedup?

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

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


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

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

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

    if 1.5e-264 < F

    1. Initial program 70.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse56.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.5 \cdot 10^{-264}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 19: 61.3% accurate, 2.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 8.6000000000000003e-265

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

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

        \[\leadsto \left(-\color{blue}{\frac{x}{\tan B}}\right) + \frac{-1}{B} \]
      2. clear-num56.7%

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

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

    if 8.6000000000000003e-265 < F

    1. Initial program 70.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse56.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 8.6 \cdot 10^{-265}:\\ \;\;\;\;\frac{-1}{B} + \frac{-1}{\frac{\tan B}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 20: 44.6% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;F \leq 7.2 \cdot 10^{-85}:\\
\;\;\;\;\cos B \cdot \frac{-x}{B}\\

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


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

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

      \[\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{-1}{B}} \]
    4. Taylor expanded in B around 0 46.7%

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

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

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

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. *-commutative46.7%

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

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

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

    if -1.4000000000000001e-39 < F < 7.1999999999999996e-85

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 31.5%

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

    if 7.1999999999999996e-85 < F

    1. Initial program 60.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{-39}:\\ \;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-85}:\\ \;\;\;\;\cos B \cdot \frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 21: 61.3% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq 7.6 \cdot 10^{-265}:\\ \;\;\;\;\frac{-1}{B} - t_0\\ \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 7.6e-265) (- (/ -1.0 B) t_0) (- (/ 1.0 B) t_0))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= 7.6e-265) {
		tmp = (-1.0 / B) - t_0;
	} 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 <= 7.6d-265) then
        tmp = ((-1.0d0) / b) - t_0
    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 <= 7.6e-265) {
		tmp = (-1.0 / B) - t_0;
	} else {
		tmp = (1.0 / B) - t_0;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = x / math.tan(B)
	tmp = 0
	if F <= 7.6e-265:
		tmp = (-1.0 / B) - t_0
	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 <= 7.6e-265)
		tmp = Float64(Float64(-1.0 / B) - t_0);
	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 <= 7.6e-265)
		tmp = (-1.0 / B) - t_0;
	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, 7.6e-265], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $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 7.6 \cdot 10^{-265}:\\
\;\;\;\;\frac{-1}{B} - t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 7.59999999999999961e-265

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1 \cdot 1}{F \cdot F}}} \cdot \frac{F}{B} \]
      5. metadata-eval30.0%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{F}} \cdot \sqrt{\frac{-1}{F}}\right)} \cdot \frac{F}{B} \]
      9. add-sqr-sqrt47.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{F}} \cdot \frac{F}{B} \]
      10. div-inv47.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-1 \cdot \frac{1}{F}\right)} \cdot \frac{F}{B} \]
      11. mul-1-neg47.5%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-\frac{1}{F}\right)} \cdot \frac{F}{B} \]
      12. cancel-sign-sub-inv47.5%

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \frac{1}{\tan B}\right)} - \frac{1}{F} \cdot \frac{F}{B} \]
      14. *-commutative47.5%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F}{B} \cdot \frac{1}{F}} \]
      15. fma-neg47.5%

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

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

        \[\leadsto \mathsf{fma}\left(-1, \frac{x}{\tan B}, -\color{blue}{\frac{F \cdot \frac{1}{F}}{B}}\right) \]
      18. rgt-mult-inverse56.7%

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{x}{\tan B}\right)} + \left(-\frac{1}{B}\right) \]
      3. distribute-neg-in56.7%

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

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

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

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

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

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

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

    if 7.59999999999999961e-265 < F

    1. Initial program 70.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{B}} - x \cdot \frac{1}{\tan B} \]
      4. rgt-mult-inverse56.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 7.6 \cdot 10^{-265}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]

Alternative 22: 53.2% accurate, 3.0× speedup?

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

\\
\frac{-1}{B} - \frac{x}{\tan B}
\end{array}
Derivation
  1. Initial program 73.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 B around 0 54.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(\sqrt{\frac{-1}{F}} \cdot \sqrt{\frac{-1}{F}}\right)} \cdot \frac{F}{B} \]
    9. add-sqr-sqrt43.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{F}} \cdot \frac{F}{B} \]
    10. div-inv43.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-1 \cdot \frac{1}{F}\right)} \cdot \frac{F}{B} \]
    11. mul-1-neg43.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(-\frac{1}{F}\right)} \cdot \frac{F}{B} \]
    12. cancel-sign-sub-inv43.3%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \frac{1}{\tan B}\right)} - \frac{1}{F} \cdot \frac{F}{B} \]
    14. *-commutative43.3%

      \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\tan B}\right) - \color{blue}{\frac{F}{B} \cdot \frac{1}{F}} \]
    15. fma-neg43.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, x \cdot \frac{1}{\tan B}, -\frac{F}{B} \cdot \frac{1}{F}\right)} \]
    16. un-div-inv43.3%

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

      \[\leadsto \mathsf{fma}\left(-1, \frac{x}{\tan B}, -\color{blue}{\frac{F \cdot \frac{1}{F}}{B}}\right) \]
    18. rgt-mult-inverse50.0%

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

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

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

      \[\leadsto \color{blue}{\left(-\frac{x}{\tan B}\right)} + \left(-\frac{1}{B}\right) \]
    3. distribute-neg-in50.0%

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

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

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

      \[\leadsto \color{blue}{\left(-\frac{1}{B}\right) - \frac{x}{\tan B}} \]
    7. distribute-neg-frac50.0%

      \[\leadsto \color{blue}{\frac{-1}{B}} - \frac{x}{\tan B} \]
    8. metadata-eval50.0%

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

    \[\leadsto \color{blue}{\frac{-1}{B} - \frac{x}{\tan B}} \]
  8. Final simplification50.0%

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

Alternative 23: 44.6% accurate, 18.9× speedup?

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

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

\mathbf{elif}\;F \leq 3 \cdot 10^{-85}:\\
\;\;\;\;B \cdot \left(x \cdot -0.16666666666666666 - x \cdot -0.5\right) - \frac{x}{B}\\

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


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

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

      \[\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{-1}{B}} \]
    4. Taylor expanded in B around 0 46.7%

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

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

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

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. *-commutative46.7%

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

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

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

    if -3.5000000000000002e-42 < F < 3.00000000000000022e-85

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 31.4%

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

    if 3.00000000000000022e-85 < F

    1. Initial program 60.6%

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

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

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

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

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

Alternative 24: 44.6% accurate, 24.8× speedup?

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

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

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

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


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

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

      \[\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{-1}{B}} \]
    4. Taylor expanded in B around 0 46.7%

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

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

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

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(B \cdot x\right) - \frac{1 + x}{B}} \]
      4. *-commutative46.7%

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

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

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

    if -2.8000000000000001e-45 < F < 1.21999999999999998e-84

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 31.3%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified31.3%

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

    if 1.21999999999999998e-84 < F

    1. Initial program 60.6%

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

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

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

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

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

Alternative 25: 44.5% accurate, 35.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -1.74999999999999999e-43

    1. Initial program 61.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 72.0%

      \[\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{-1}{B}} \]
    4. Taylor expanded in B around 0 45.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. associate-*r/45.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. mul-1-neg45.9%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
    6. Simplified45.9%

      \[\leadsto \color{blue}{\frac{-\left(1 + x\right)}{B}} \]

    if -1.74999999999999999e-43 < F < 6.5e-85

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 65.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg65.9%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/66.0%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in66.0%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified66.0%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 31.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/31.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-131.3%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified31.3%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 6.5e-85 < F

    1. Initial program 60.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 42.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 47.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 43.1%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.75 \cdot 10^{-43}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-85}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 26: 44.5% accurate, 35.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-36}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.66 \cdot 10^{-84}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e-36)
   (- (/ -1.0 B) (/ x B))
   (if (<= F 1.66e-84) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -3e-36) {
		tmp = (-1.0 / B) - (x / B);
	} else if (F <= 1.66e-84) {
		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 <= (-3d-36)) then
        tmp = ((-1.0d0) / b) - (x / b)
    else if (f <= 1.66d-84) 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 <= -3e-36) {
		tmp = (-1.0 / B) - (x / B);
	} else if (F <= 1.66e-84) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -3e-36:
		tmp = (-1.0 / B) - (x / B)
	elif F <= 1.66e-84:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -3e-36)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / B));
	elseif (F <= 1.66e-84)
		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 <= -3e-36)
		tmp = (-1.0 / B) - (x / B);
	elseif (F <= 1.66e-84)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -3e-36], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.66e-84], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{-36}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.66 \cdot 10^{-84}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -3.0000000000000002e-36

    1. Initial program 61.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 72.0%

      \[\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{-1}{B}} \]
    4. Taylor expanded in B around 0 45.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{B} \]

    if -3.0000000000000002e-36 < F < 1.6600000000000001e-84

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in99.5%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def99.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity99.5%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 65.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg65.9%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/66.0%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in66.0%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified66.0%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 31.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/31.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-131.3%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified31.3%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.6600000000000001e-84 < F

    1. Initial program 60.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 42.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 47.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 43.1%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-36}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.66 \cdot 10^{-84}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 27: 30.8% accurate, 39.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-49} \lor \neg \left(x \leq 1.4 \cdot 10^{-112}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -2.5e-49) (not (<= x 1.4e-112))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.5e-49) || !(x <= 1.4e-112)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-2.5d-49)) .or. (.not. (x <= 1.4d-112))) then
        tmp = -x / b
    else
        tmp = (-1.0d0) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.5e-49) || !(x <= 1.4e-112)) {
		tmp = -x / B;
	} else {
		tmp = -1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -2.5e-49) or not (x <= 1.4e-112):
		tmp = -x / B
	else:
		tmp = -1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -2.5e-49) || !(x <= 1.4e-112))
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(-1.0 / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -2.5e-49) || ~((x <= 1.4e-112)))
		tmp = -x / B;
	else
		tmp = -1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.5e-49], N[Not[LessEqual[x, 1.4e-112]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-49} \lor \neg \left(x \leq 1.4 \cdot 10^{-112}\right):\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4999999999999999e-49 or 1.40000000000000011e-112 < x

    1. Initial program 75.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in75.8%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative75.8%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def75.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity75.8%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified75.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 82.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg82.0%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/81.9%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in81.9%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified81.9%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 42.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/42.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-142.2%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified42.2%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if -2.4999999999999999e-49 < x < 1.40000000000000011e-112

    1. Initial program 70.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 21.0%

      \[\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 17.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
    4. Taylor expanded in x around 0 16.1%

      \[\leadsto \color{blue}{\frac{-1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-49} \lor \neg \left(x \leq 1.4 \cdot 10^{-112}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]

Alternative 28: 37.5% accurate, 45.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.7 \cdot 10^{-84}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F 1.7e-84) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
	double tmp;
	if (F <= 1.7e-84) {
		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.7d-84) 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.7e-84) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= 1.7e-84:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= 1.7e-84)
		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.7e-84)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, 1.7e-84], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.7 \cdot 10^{-84}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.7000000000000001e-84

    1. Initial program 80.7%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. distribute-lft-neg-in80.7%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. +-commutative80.7%

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x\right) \cdot \frac{1}{\tan B}} \]
      3. fma-def80.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right)} \]
      4. +-commutative80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      5. *-commutative80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\color{blue}{x \cdot 2} + \left(F \cdot F + 2\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      6. fma-def80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\color{blue}{\left(\mathsf{fma}\left(x, 2, F \cdot F + 2\right)\right)}}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      7. fma-def80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)\right)}^{\left(-\frac{1}{2}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      8. metadata-eval80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      9. metadata-eval80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}, \left(-x\right) \cdot \frac{1}{\tan B}\right) \]
      10. associate-*r/80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \color{blue}{\frac{\left(-x\right) \cdot 1}{\tan B}}\right) \]
      11. *-rgt-identity80.7%

        \[\leadsto \mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{\color{blue}{-x}}{\tan B}\right) \]
    3. Simplified80.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)} \]
    4. Taylor expanded in F around 0 55.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
    5. Step-by-step derivation
      1. mul-1-neg55.2%

        \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
      2. associate-*l/55.2%

        \[\leadsto -\color{blue}{\frac{x}{\sin B} \cdot \cos B} \]
      3. distribute-rgt-neg-in55.2%

        \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    6. Simplified55.2%

      \[\leadsto \color{blue}{\frac{x}{\sin B} \cdot \left(-\cos B\right)} \]
    7. Taylor expanded in B around 0 27.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/27.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-127.2%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified27.2%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]

    if 1.7000000000000001e-84 < F

    1. Initial program 60.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Taylor expanded in B around 0 42.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    3. Taylor expanded in F around inf 47.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 43.1%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.7 \cdot 10^{-84}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]

Alternative 29: 10.2% 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 73.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 46.2%

    \[\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.0%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{B}} \]
  4. Taylor expanded in x around 0 10.4%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  5. Final simplification10.4%

    \[\leadsto \frac{-1}{B} \]

Reproduce

?
herbie shell --seed 2023311 
(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))))))