VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.3% → 99.7%
Time: 1.4min
Alternatives: 24
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 alternatives:

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

Initial Program: 76.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.6× speedup?

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

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

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

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

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

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

    if -8e18 < F < 4.7000000000000002e29

    1. Initial program 98.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. Simplified99.6%

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

    if 4.7000000000000002e29 < F

    1. Initial program 50.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. Simplified66.6%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;F \leq 4.4 \cdot 10^{+29}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\

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


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

    1. Initial program 54.4%

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

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

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

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

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

    if -2.00000000000000009e48 < F < 4.4000000000000003e29

    1. Initial program 98.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. Simplified99.6%

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

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

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

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

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

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

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

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

    if 4.4000000000000003e29 < F

    1. Initial program 50.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. Simplified66.6%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 12500000:\\
\;\;\;\;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} - \frac{x}{\tan B}\\


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

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

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

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

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

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

    if -9.9999999999999992e22 < F < 1.25e7

    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. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv37.4%

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

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

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

    if 1.25e7 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

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

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

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

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

    if -4e18 < F < 1.15e8

    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. Add Preprocessing

    if 1.15e8 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.9%

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

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

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

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

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

    if -1.3999999999999999 < F < 1.4199999999999999

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

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

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

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

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

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

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

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

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

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

    if 1.4199999999999999 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.8% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -4.8 \cdot 10^{-123}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 0.195:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 61.4%

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

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

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

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

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

    if -2.75000000000000017e-4 < F < -4.8e-123 or 3.39999999999999977e-134 < F < 0.19500000000000001

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8e-123 < F < 3.39999999999999977e-134

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-\cos B}{\sin B}} \]
    10. Simplified88.0%

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

    if 0.19500000000000001 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.000275:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -4.8 \cdot 10^{-123}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.4 \cdot 10^{-134}:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.195:\\ \;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.3% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -9.2 \cdot 10^{-93}:\\
\;\;\;\;\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 0.36:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\

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


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

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

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

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

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

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

    if -4e18 < F < -9.1999999999999993e-93

    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. Add Preprocessing
    3. Taylor expanded in B around 0 93.7%

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

    if -9.1999999999999993e-93 < F < 0.35999999999999999

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.35999999999999999 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -9.2 \cdot 10^{-93}:\\ \;\;\;\;\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 0.36:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 92.2% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -1.5 \cdot 10^{-95}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{t\_0}} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 0.46:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\

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


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

    1. Initial program 61.4%

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

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

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

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

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

    if -2.75000000000000017e-4 < F < -1.5e-95

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e-95 < F < 0.46000000000000002

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.46000000000000002 < F

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 83.9% accurate, 1.5× speedup?

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

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

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

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

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


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

    1. Initial program 67.6%

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

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

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

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

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

    if -4.00000000000000012e-117 < F < 4.59999999999999987e-119

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-\cos B}{\sin B}} \]
    10. Simplified85.7%

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

    if 4.59999999999999987e-119 < F < 0.0033

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0033 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-117}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 4.6 \cdot 10^{-119}:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.0033:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 83.9% accurate, 1.5× speedup?

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000012e-117 < F < 7.1999999999999999e-127

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-\cos B}{\sin B}} \]
    10. Simplified85.7%

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

    if 7.1999999999999999e-127 < F < 0.0140000000000000003

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0140000000000000003 < F

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-117}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-127}:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.014:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 77.2% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 1.55 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -4.00000000000000012e-117

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000012e-117 < F < 6.20000000000000041e-131

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-\cos B}{\sin B}} \]
    10. Simplified85.7%

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

    if 6.20000000000000041e-131 < F < 0.0719999999999999946

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0719999999999999946 < F < 1.55e47

    1. Initial program 84.9%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt15.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval47.8%

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/47.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv76.4%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F} + \left(-\frac{x}{B}\right)} \]
      2. /-rgt-identity91.4%

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

        \[\leadsto \frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1} + \color{blue}{\frac{-x}{B}} \]
      4. frac-add91.4%

        \[\leadsto \color{blue}{\frac{\left(\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B}} \]
      5. /-rgt-identity91.4%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B}} \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      8. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \color{blue}{\left(-x\right)}}{1 \cdot B} \]
      9. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{\color{blue}{B}} \]
    8. Applied egg-rr91.0%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F \cdot B}{F \cdot \sin B}} - x}{B} \]
      3. times-frac91.4%

        \[\leadsto \frac{\color{blue}{\frac{F}{F} \cdot \frac{B}{\sin B}} - x}{B} \]
      4. *-inverses91.4%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{B}{\sin B} - x}{B} \]
    10. Simplified91.4%

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

    if 1.55e47 < F < 1.02e209

    1. Initial program 71.9%

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

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

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

    if 1.02e209 < F

    1. Initial program 18.0%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt11.0%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval39.3%

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up39.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/29.2%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up29.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/29.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv37.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr86.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-117}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{-131}:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.072:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \mathbf{elif}\;F \leq 1.02 \cdot 10^{+209}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 71.9% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 1.42 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\

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

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


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

    1. Initial program 60.4%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      2. div-inv76.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac276.9%

        \[\leadsto \mathsf{fma}\left(-1, \frac{1}{\sin B}, \color{blue}{\frac{x}{-B}}\right) \]
    6. Applied egg-rr76.9%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + \frac{x}{-B}} \]
      2. distribute-frac-neg276.9%

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

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

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

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

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

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

    if -0.059999999999999998 < F < 1.09999999999999992e-118

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.09999999999999992e-118 < F < 0.26000000000000001

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.26000000000000001 < F < 1.42e47

    1. Initial program 84.9%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt15.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval47.8%

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/47.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv76.4%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F} + \left(-\frac{x}{B}\right)} \]
      2. /-rgt-identity91.4%

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

        \[\leadsto \frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1} + \color{blue}{\frac{-x}{B}} \]
      4. frac-add91.4%

        \[\leadsto \color{blue}{\frac{\left(\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B}} \]
      5. /-rgt-identity91.4%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B}} \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      8. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \color{blue}{\left(-x\right)}}{1 \cdot B} \]
      9. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{\color{blue}{B}} \]
    8. Applied egg-rr91.0%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F \cdot B}{F \cdot \sin B}} - x}{B} \]
      3. times-frac91.4%

        \[\leadsto \frac{\color{blue}{\frac{F}{F} \cdot \frac{B}{\sin B}} - x}{B} \]
      4. *-inverses91.4%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{B}{\sin B} - x}{B} \]
    10. Simplified91.4%

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

    if 1.42e47 < F < 1.10000000000000001e206

    1. Initial program 71.9%

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

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

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

    if 1.10000000000000001e206 < F

    1. Initial program 18.0%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt11.0%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval39.3%

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up39.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/29.2%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up29.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/29.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv37.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr86.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.06:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-118}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.26:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{+206}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 71.9% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 1.7 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\

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

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


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

    1. Initial program 60.4%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      2. div-inv76.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac276.9%

        \[\leadsto \mathsf{fma}\left(-1, \frac{1}{\sin B}, \color{blue}{\frac{x}{-B}}\right) \]
    6. Applied egg-rr76.9%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + \frac{x}{-B}} \]
      2. distribute-frac-neg276.9%

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

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

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

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

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

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

    if -0.070000000000000007 < F < 3.49999999999999985e-107

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.49999999999999985e-107 < F < 0.024

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.024 < F < 1.6999999999999999e47

    1. Initial program 84.9%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt15.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval47.8%

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/47.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv76.4%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F} + \left(-\frac{x}{B}\right)} \]
      2. /-rgt-identity91.4%

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

        \[\leadsto \frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1} + \color{blue}{\frac{-x}{B}} \]
      4. frac-add91.4%

        \[\leadsto \color{blue}{\frac{\left(\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B}} \]
      5. /-rgt-identity91.4%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B}} \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      8. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \color{blue}{\left(-x\right)}}{1 \cdot B} \]
      9. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{\color{blue}{B}} \]
    8. Applied egg-rr91.0%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F \cdot B}{F \cdot \sin B}} - x}{B} \]
      3. times-frac91.4%

        \[\leadsto \frac{\color{blue}{\frac{F}{F} \cdot \frac{B}{\sin B}} - x}{B} \]
      4. *-inverses91.4%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{B}{\sin B} - x}{B} \]
    10. Simplified91.4%

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

    if 1.6999999999999999e47 < F < 3.14999999999999998e206

    1. Initial program 71.9%

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

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

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

    if 3.14999999999999998e206 < F

    1. Initial program 18.0%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt11.0%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval39.3%

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up39.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/29.2%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up29.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/29.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv37.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr86.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.07:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-107}:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.024:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \mathbf{elif}\;F \leq 3.15 \cdot 10^{+206}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 63.6% accurate, 2.4× speedup?

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

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

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

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

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

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

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


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

    1. Initial program 55.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac279.2%

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

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

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

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

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

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

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

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

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

    if -9.4999999999999996e41 < F < 7.19999999999999964e-250

    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. Add Preprocessing
    3. Taylor expanded in F around -inf 44.2%

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

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

    if 7.19999999999999964e-250 < F < 0.13500000000000001

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.13500000000000001 < F < 1.6e47

    1. Initial program 84.9%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt15.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval47.8%

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/47.8%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv76.4%

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

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

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F} + \left(-\frac{x}{B}\right)} \]
      2. /-rgt-identity91.4%

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

        \[\leadsto \frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1} + \color{blue}{\frac{-x}{B}} \]
      4. frac-add91.4%

        \[\leadsto \color{blue}{\frac{\left(\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B}} \]
      5. /-rgt-identity91.4%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B}} \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      8. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \color{blue}{\left(-x\right)}}{1 \cdot B} \]
      9. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{\color{blue}{B}} \]
    8. Applied egg-rr91.0%

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

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

        \[\leadsto \frac{\color{blue}{\frac{F \cdot B}{F \cdot \sin B}} - x}{B} \]
      3. times-frac91.4%

        \[\leadsto \frac{\color{blue}{\frac{F}{F} \cdot \frac{B}{\sin B}} - x}{B} \]
      4. *-inverses91.4%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{B}{\sin B} - x}{B} \]
    10. Simplified91.4%

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

    if 1.6e47 < F < 1.1200000000000001e205

    1. Initial program 71.9%

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

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

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

    if 1.1200000000000001e205 < F

    1. Initial program 18.0%

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

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt11.0%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval39.3%

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

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

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up39.2%

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

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/29.2%

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

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow129.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      19. sqrt-unprod18.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} \]
      20. add-sqr-sqrt37.5%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv37.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr86.6%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}} \]
    7. Taylor expanded in x around 0 86.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. mul-1-neg86.7%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \frac{1}{\sin B} \]
      2. +-commutative86.7%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      3. sub-neg86.7%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    9. Simplified86.7%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification72.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.5 \cdot 10^{+41}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 7.2 \cdot 10^{-250}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 0.135:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.6 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \mathbf{elif}\;F \leq 1.12 \cdot 10^{+205}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 64.3% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.38:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+206}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.6e-33)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 0.38)
     (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
     (if (<= F 1.42e+47)
       (/ (- (/ B (sin B)) x) B)
       (if (<= F 1.55e+206)
         (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
         (- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.6e-33) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 0.38) {
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (F <= 1.42e+47) {
		tmp = ((B / sin(B)) - x) / B;
	} else if (F <= 1.55e+206) {
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-1.6d-33)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 0.38d0) then
        tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
    else if (f <= 1.42d+47) then
        tmp = ((b / sin(b)) - x) / b
    else if (f <= 1.55d+206) then
        tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.6e-33) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 0.38) {
		tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	} else if (F <= 1.42e+47) {
		tmp = ((B / Math.sin(B)) - x) / B;
	} else if (F <= 1.55e+206) {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.6e-33:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 0.38:
		tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B
	elif F <= 1.42e+47:
		tmp = ((B / math.sin(B)) - x) / B
	elif F <= 1.55e+206:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.6e-33)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 0.38)
		tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B);
	elseif (F <= 1.42e+47)
		tmp = Float64(Float64(Float64(B / sin(B)) - x) / B);
	elseif (F <= 1.55e+206)
		tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.6e-33)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 0.38)
		tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
	elseif (F <= 1.42e+47)
		tmp = ((B / sin(B)) - x) / B;
	elseif (F <= 1.55e+206)
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.6e-33], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.38], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42e+47], N[(N[(N[(B / N[Sin[B], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.55e+206], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 0.38:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\

\mathbf{elif}\;F \leq 1.42 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\

\mathbf{elif}\;F \leq 1.55 \cdot 10^{+206}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -1.59999999999999988e-33

    1. Initial program 63.3%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 93.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 74.0%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. +-commutative74.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      2. div-inv74.0%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B}} + \left(-\frac{x}{B}\right) \]
      3. fma-define74.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac274.0%

        \[\leadsto \mathsf{fma}\left(-1, \frac{1}{\sin B}, \color{blue}{\frac{x}{-B}}\right) \]
    6. Applied egg-rr74.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{x}{-B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine74.0%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + \frac{x}{-B}} \]
      2. distribute-frac-neg274.0%

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      3. unsub-neg74.0%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} - \frac{x}{B}} \]
      4. neg-mul-174.0%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      5. distribute-neg-frac74.0%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      6. metadata-eval74.0%

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{B} \]
    8. Simplified74.0%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -1.59999999999999988e-33 < F < 0.38

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x} \cdot \sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}}^{\left(-\frac{1}{2}\right)} \]
      2. unpow-prod-down99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\left({\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right)} \]
      3. +-commutative99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\color{blue}{2 \cdot x + \left(F \cdot F + 2\right)}}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      4. fma-define99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\color{blue}{\mathsf{fma}\left(2, x, F \cdot F + 2\right)}}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      5. fma-define99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}\right)}^{\left(-\frac{1}{2}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      6. metadata-eval99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\color{blue}{0.5}\right)} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      7. metadata-eval99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\color{blue}{-0.5}} \cdot {\left(\sqrt{\left(F \cdot F + 2\right) + 2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      8. +-commutative99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{2 \cdot x + \left(F \cdot F + 2\right)}}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      9. fma-define99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\color{blue}{\mathsf{fma}\left(2, x, F \cdot F + 2\right)}}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      10. fma-define99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}\right)}^{\left(-\frac{1}{2}\right)}\right) \]
      11. metadata-eval99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(-\color{blue}{0.5}\right)}\right) \]
      12. metadata-eval99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\color{blue}{-0.5}}\right) \]
    4. Applied egg-rr99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-0.5}\right)} \]
    5. Step-by-step derivation
      1. pow-sqr99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval99.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{\color{blue}{-1}} \]
      3. unpow-199.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    6. Simplified99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}} \]
    7. Taylor expanded in F around 0 99.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \frac{1}{\color{blue}{\sqrt{2 + 2 \cdot x}}} \]
    8. Taylor expanded in B around 0 55.9%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} - x}{B}} \]

    if 0.38 < F < 1.42e47

    1. Initial program 84.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 23.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 16.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt15.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}} \]
      2. sqrt-unprod47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      3. frac-times47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      5. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      6. frac-times47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow147.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/47.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      19. sqrt-unprod38.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} \]
      20. add-sqr-sqrt76.5%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv76.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr91.4%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}} \]
    7. Step-by-step derivation
      1. +-commutative91.4%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F} + \left(-\frac{x}{B}\right)} \]
      2. /-rgt-identity91.4%

        \[\leadsto \color{blue}{\frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1}} + \left(-\frac{x}{B}\right) \]
      3. distribute-neg-frac91.4%

        \[\leadsto \frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1} + \color{blue}{\frac{-x}{B}} \]
      4. frac-add91.4%

        \[\leadsto \color{blue}{\frac{\left(\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B}} \]
      5. /-rgt-identity91.4%

        \[\leadsto \frac{\left(\color{blue}{F} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      6. associate-/l/91.0%

        \[\leadsto \frac{\left(F \cdot \color{blue}{\frac{1}{F \cdot \sin B}}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      7. un-div-inv91.0%

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B}} \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      8. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \color{blue}{\left(-x\right)}}{1 \cdot B} \]
      9. *-un-lft-identity91.0%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{\color{blue}{B}} \]
    8. Applied egg-rr91.0%

      \[\leadsto \color{blue}{\frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{B}} \]
    9. Step-by-step derivation
      1. unsub-neg91.0%

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B} \cdot B - x}}{B} \]
      2. associate-*l/91.4%

        \[\leadsto \frac{\color{blue}{\frac{F \cdot B}{F \cdot \sin B}} - x}{B} \]
      3. times-frac91.4%

        \[\leadsto \frac{\color{blue}{\frac{F}{F} \cdot \frac{B}{\sin B}} - x}{B} \]
      4. *-inverses91.4%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{B}{\sin B} - x}{B} \]
    10. Simplified91.4%

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{B}{\sin B} - x}{B}} \]

    if 1.42e47 < F < 1.54999999999999995e206

    1. Initial program 71.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 89.1%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 85.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]

    if 1.54999999999999995e206 < F

    1. Initial program 18.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 38.3%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 25.1%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt11.0%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}} \]
      2. sqrt-unprod39.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      3. frac-times39.3%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval39.3%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      5. metadata-eval39.3%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      6. frac-times39.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. metadata-eval39.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval39.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up39.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow139.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow39.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow129.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/29.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      19. sqrt-unprod18.2%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} \]
      20. add-sqr-sqrt37.5%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv37.4%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr86.6%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}} \]
    7. Taylor expanded in x around 0 86.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. mul-1-neg86.7%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \frac{1}{\sin B} \]
      2. +-commutative86.7%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      3. sub-neg86.7%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    9. Simplified86.7%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification71.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-33}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.38:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+206}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 61.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.185:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-14} \lor \neg \left(F \leq 1.1 \cdot 10^{+47}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.185)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F 1.1e-14) (not (<= F 1.1e+47)))
     (- (/ 1.0 B) (/ x (tan B)))
     (/ (- (/ B (sin B)) x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.185) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= 1.1e-14) || !(F <= 1.1e+47)) {
		tmp = (1.0 / B) - (x / tan(B));
	} else {
		tmp = ((B / sin(B)) - x) / B;
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.185d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= 1.1d-14) .or. (.not. (f <= 1.1d+47))) then
        tmp = (1.0d0 / b) - (x / tan(b))
    else
        tmp = ((b / sin(b)) - x) / b
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.185) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= 1.1e-14) || !(F <= 1.1e+47)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = ((B / Math.sin(B)) - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.185:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= 1.1e-14) or not (F <= 1.1e+47):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = ((B / math.sin(B)) - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.185)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= 1.1e-14) || !(F <= 1.1e+47))
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(Float64(B / sin(B)) - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.185)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= 1.1e-14) || ~((F <= 1.1e+47)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = ((B / sin(B)) - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.185], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.1e-14], N[Not[LessEqual[F, 1.1e+47]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(B / N[Sin[B], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.185:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-14} \lor \neg \left(F \leq 1.1 \cdot 10^{+47}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -0.185

    1. Initial program 60.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 76.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. +-commutative76.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      2. div-inv76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B}} + \left(-\frac{x}{B}\right) \]
      3. fma-define76.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac276.9%

        \[\leadsto \mathsf{fma}\left(-1, \frac{1}{\sin B}, \color{blue}{\frac{x}{-B}}\right) \]
    6. Applied egg-rr76.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{x}{-B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + \frac{x}{-B}} \]
      2. distribute-frac-neg276.9%

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      3. unsub-neg76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} - \frac{x}{B}} \]
      4. neg-mul-176.9%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      5. distribute-neg-frac76.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      6. metadata-eval76.9%

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{B} \]
    8. Simplified76.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -0.185 < F < 1.1e-14 or 1.1e47 < F

    1. Initial program 79.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 50.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 63.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Step-by-step derivation
      1. +-commutative63.0%

        \[\leadsto \color{blue}{\frac{1}{B} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg63.0%

        \[\leadsto \color{blue}{\frac{1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv63.1%

        \[\leadsto \frac{1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    6. Applied egg-rr63.1%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]

    if 1.1e-14 < F < 1.1e47

    1. Initial program 85.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 22.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 15.7%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt14.7%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}} \]
      2. sqrt-unprod44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      3. frac-times44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      5. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      6. frac-times44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow144.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow144.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      19. sqrt-unprod36.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} \]
      20. add-sqr-sqrt71.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv71.7%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr85.6%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}} \]
    7. Step-by-step derivation
      1. +-commutative85.6%

        \[\leadsto \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F} + \left(-\frac{x}{B}\right)} \]
      2. /-rgt-identity85.6%

        \[\leadsto \color{blue}{\frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1}} + \left(-\frac{x}{B}\right) \]
      3. distribute-neg-frac85.6%

        \[\leadsto \frac{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}}{1} + \color{blue}{\frac{-x}{B}} \]
      4. frac-add85.6%

        \[\leadsto \color{blue}{\frac{\left(\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B}} \]
      5. /-rgt-identity85.6%

        \[\leadsto \frac{\left(\color{blue}{F} \cdot \frac{\frac{1}{\sin B}}{F}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      6. associate-/l/85.2%

        \[\leadsto \frac{\left(F \cdot \color{blue}{\frac{1}{F \cdot \sin B}}\right) \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      7. un-div-inv85.2%

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B}} \cdot B + 1 \cdot \left(-x\right)}{1 \cdot B} \]
      8. *-un-lft-identity85.2%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \color{blue}{\left(-x\right)}}{1 \cdot B} \]
      9. *-un-lft-identity85.2%

        \[\leadsto \frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{\color{blue}{B}} \]
    8. Applied egg-rr85.2%

      \[\leadsto \color{blue}{\frac{\frac{F}{F \cdot \sin B} \cdot B + \left(-x\right)}{B}} \]
    9. Step-by-step derivation
      1. unsub-neg85.2%

        \[\leadsto \frac{\color{blue}{\frac{F}{F \cdot \sin B} \cdot B - x}}{B} \]
      2. associate-*l/85.6%

        \[\leadsto \frac{\color{blue}{\frac{F \cdot B}{F \cdot \sin B}} - x}{B} \]
      3. times-frac85.6%

        \[\leadsto \frac{\color{blue}{\frac{F}{F} \cdot \frac{B}{\sin B}} - x}{B} \]
      4. *-inverses85.6%

        \[\leadsto \frac{\color{blue}{1} \cdot \frac{B}{\sin B} - x}{B} \]
    10. Simplified85.6%

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{B}{\sin B} - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.185:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-14} \lor \neg \left(F \leq 1.1 \cdot 10^{+47}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{B}{\sin B} - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 61.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.03:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-14} \lor \neg \left(F \leq 1.75 \cdot 10^{+47}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.03)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (or (<= F 1.4e-14) (not (<= F 1.75e+47)))
     (- (/ 1.0 B) (/ x (tan B)))
     (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.03) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if ((F <= 1.4e-14) || !(F <= 1.75e+47)) {
		tmp = (1.0 / B) - (x / tan(B));
	} else {
		tmp = (1.0 / sin(B)) - (x / B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.03d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if ((f <= 1.4d-14) .or. (.not. (f <= 1.75d+47))) then
        tmp = (1.0d0 / b) - (x / tan(b))
    else
        tmp = (1.0d0 / sin(b)) - (x / b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.03) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if ((F <= 1.4e-14) || !(F <= 1.75e+47)) {
		tmp = (1.0 / B) - (x / Math.tan(B));
	} else {
		tmp = (1.0 / Math.sin(B)) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.03:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif (F <= 1.4e-14) or not (F <= 1.75e+47):
		tmp = (1.0 / B) - (x / math.tan(B))
	else:
		tmp = (1.0 / math.sin(B)) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.03)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif ((F <= 1.4e-14) || !(F <= 1.75e+47))
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.03)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif ((F <= 1.4e-14) || ~((F <= 1.75e+47)))
		tmp = (1.0 / B) - (x / tan(B));
	else
		tmp = (1.0 / sin(B)) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.03], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.4e-14], N[Not[LessEqual[F, 1.75e+47]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.03:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.4 \cdot 10^{-14} \lor \neg \left(F \leq 1.75 \cdot 10^{+47}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -0.029999999999999999

    1. Initial program 60.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 76.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. +-commutative76.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      2. div-inv76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B}} + \left(-\frac{x}{B}\right) \]
      3. fma-define76.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac276.9%

        \[\leadsto \mathsf{fma}\left(-1, \frac{1}{\sin B}, \color{blue}{\frac{x}{-B}}\right) \]
    6. Applied egg-rr76.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{x}{-B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + \frac{x}{-B}} \]
      2. distribute-frac-neg276.9%

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      3. unsub-neg76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} - \frac{x}{B}} \]
      4. neg-mul-176.9%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      5. distribute-neg-frac76.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      6. metadata-eval76.9%

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{B} \]
    8. Simplified76.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -0.029999999999999999 < F < 1.4e-14 or 1.75000000000000008e47 < F

    1. Initial program 79.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 50.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 63.0%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Step-by-step derivation
      1. +-commutative63.0%

        \[\leadsto \color{blue}{\frac{1}{B} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg63.0%

        \[\leadsto \color{blue}{\frac{1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv63.1%

        \[\leadsto \frac{1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    6. Applied egg-rr63.1%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]

    if 1.4e-14 < F < 1.75000000000000008e47

    1. Initial program 85.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 22.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 15.7%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt14.7%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B}} \cdot \sqrt{\frac{-1}{\sin B}}} \]
      2. sqrt-unprod44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} \]
      3. frac-times44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} \]
      4. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} \]
      5. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} \]
      6. frac-times44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{0}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      8. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      9. pow-prod-up44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      10. pow144.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B} \cdot \frac{1}{\sin B}} \]
      11. inv-pow44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B} \cdot \frac{1}{\sin B}} \]
      12. associate-*l/44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} \]
      13. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{0}}}{\sin B}} \]
      14. metadata-eval44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{{F}^{\color{blue}{\left(1 + -1\right)}}}{\sin B}} \]
      15. pow-prod-up44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{{F}^{1} \cdot {F}^{-1}}}{\sin B}} \]
      16. pow144.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{\color{blue}{F} \cdot {F}^{-1}}{\sin B}} \]
      17. inv-pow44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \frac{F \cdot \color{blue}{\frac{1}{F}}}{\sin B}} \]
      18. associate-*l/44.9%

        \[\leadsto \left(-\frac{x}{B}\right) + \sqrt{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right) \cdot \color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)}} \]
      19. sqrt-unprod36.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} \]
      20. add-sqr-sqrt71.8%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{\sin B} \cdot \frac{1}{F}} \]
      21. un-div-inv71.7%

        \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{\frac{F}{\sin B}}{F}} \]
    6. Applied egg-rr85.6%

      \[\leadsto \left(-\frac{x}{B}\right) + \color{blue}{\frac{F}{1} \cdot \frac{\frac{1}{\sin B}}{F}} \]
    7. Taylor expanded in x around 0 85.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B} + \frac{1}{\sin B}} \]
    8. Step-by-step derivation
      1. mul-1-neg85.5%

        \[\leadsto \color{blue}{\left(-\frac{x}{B}\right)} + \frac{1}{\sin B} \]
      2. +-commutative85.5%

        \[\leadsto \color{blue}{\frac{1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      3. sub-neg85.5%

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
    9. Simplified85.5%

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.03:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.4 \cdot 10^{-14} \lor \neg \left(F \leq 1.75 \cdot 10^{+47}\right):\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 43.7% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{\sin B}\\ \mathbf{if}\;F \leq -6 \cdot 10^{+245}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -6.6 \cdot 10^{+195}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -0.185:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ -1.0 (sin B))))
   (if (<= F -6e+245)
     t_0
     (if (<= F -6.6e+195)
       (/ (- -1.0 x) B)
       (if (<= F -0.185)
         t_0
         (if (<= F 1.05e-136) (/ (- x) B) (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
	double t_0 = -1.0 / sin(B);
	double tmp;
	if (F <= -6e+245) {
		tmp = t_0;
	} else if (F <= -6.6e+195) {
		tmp = (-1.0 - x) / B;
	} else if (F <= -0.185) {
		tmp = t_0;
	} else if (F <= 1.05e-136) {
		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) :: t_0
    real(8) :: tmp
    t_0 = (-1.0d0) / sin(b)
    if (f <= (-6d+245)) then
        tmp = t_0
    else if (f <= (-6.6d+195)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= (-0.185d0)) then
        tmp = t_0
    else if (f <= 1.05d-136) 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 t_0 = -1.0 / Math.sin(B);
	double tmp;
	if (F <= -6e+245) {
		tmp = t_0;
	} else if (F <= -6.6e+195) {
		tmp = (-1.0 - x) / B;
	} else if (F <= -0.185) {
		tmp = t_0;
	} else if (F <= 1.05e-136) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -1.0 / math.sin(B)
	tmp = 0
	if F <= -6e+245:
		tmp = t_0
	elif F <= -6.6e+195:
		tmp = (-1.0 - x) / B
	elif F <= -0.185:
		tmp = t_0
	elif F <= 1.05e-136:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	t_0 = Float64(-1.0 / sin(B))
	tmp = 0.0
	if (F <= -6e+245)
		tmp = t_0;
	elseif (F <= -6.6e+195)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= -0.185)
		tmp = t_0;
	elseif (F <= 1.05e-136)
		tmp = Float64(Float64(-x) / B);
	else
		tmp = Float64(Float64(1.0 - x) / B);
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -1.0 / sin(B);
	tmp = 0.0;
	if (F <= -6e+245)
		tmp = t_0;
	elseif (F <= -6.6e+195)
		tmp = (-1.0 - x) / B;
	elseif (F <= -0.185)
		tmp = t_0;
	elseif (F <= 1.05e-136)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6e+245], t$95$0, If[LessEqual[F, -6.6e+195], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -0.185], t$95$0, If[LessEqual[F, 1.05e-136], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{+245}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -6.6 \cdot 10^{+195}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq -0.185:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -6e245 or -6.5999999999999999e195 < F < -0.185

    1. Initial program 64.9%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 95.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 75.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around 0 61.2%

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

    if -6e245 < F < -6.5999999999999999e195

    1. Initial program 43.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 81.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in B around 0 75.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. associate-*r/75.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in75.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval75.8%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-175.8%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
      5. unsub-neg75.8%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    7. Simplified75.8%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -0.185 < F < 1.0499999999999999e-136

    1. Initial program 99.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 37.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 23.8%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around inf 42.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg42.2%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg242.2%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified42.2%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]

    if 1.0499999999999999e-136 < F

    1. Initial program 64.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 65.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 69.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Taylor expanded in B around 0 48.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification51.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{+245}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -6.6 \cdot 10^{+195}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -0.185:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 61.0% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.082:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -0.082) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.082) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x / tan(B));
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-0.082d0)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else
        tmp = (1.0d0 / b) - (x / tan(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -0.082) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else {
		tmp = (1.0 / B) - (x / Math.tan(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -0.082:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	else:
		tmp = (1.0 / B) - (x / math.tan(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -0.082)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	else
		tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -0.082)
		tmp = (-1.0 / sin(B)) - (x / B);
	else
		tmp = (1.0 / B) - (x / tan(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -0.082], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $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 -0.082:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -0.0820000000000000034

    1. Initial program 60.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 96.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 76.9%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. +-commutative76.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      2. div-inv76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B}} + \left(-\frac{x}{B}\right) \]
      3. fma-define76.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac276.9%

        \[\leadsto \mathsf{fma}\left(-1, \frac{1}{\sin B}, \color{blue}{\frac{x}{-B}}\right) \]
    6. Applied egg-rr76.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{x}{-B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + \frac{x}{-B}} \]
      2. distribute-frac-neg276.9%

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      3. unsub-neg76.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} - \frac{x}{B}} \]
      4. neg-mul-176.9%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      5. distribute-neg-frac76.9%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      6. metadata-eval76.9%

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{B} \]
    8. Simplified76.9%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -0.0820000000000000034 < F

    1. Initial program 80.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 52.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 62.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Step-by-step derivation
      1. +-commutative62.2%

        \[\leadsto \color{blue}{\frac{1}{B} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      2. unsub-neg62.2%

        \[\leadsto \color{blue}{\frac{1}{B} - x \cdot \frac{1}{\tan B}} \]
      3. un-div-inv62.2%

        \[\leadsto \frac{1}{B} - \color{blue}{\frac{x}{\tan B}} \]
    6. Applied egg-rr62.2%

      \[\leadsto \color{blue}{\frac{1}{B} - \frac{x}{\tan B}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 49.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-138}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.9e-138)
   (- (/ -1.0 (sin B)) (/ x B))
   (if (<= F 1.05e-136) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.9e-138) {
		tmp = (-1.0 / sin(B)) - (x / B);
	} else if (F <= 1.05e-136) {
		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.9d-138)) then
        tmp = ((-1.0d0) / sin(b)) - (x / b)
    else if (f <= 1.05d-136) 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.9e-138) {
		tmp = (-1.0 / Math.sin(B)) - (x / B);
	} else if (F <= 1.05e-136) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.9e-138:
		tmp = (-1.0 / math.sin(B)) - (x / B)
	elif F <= 1.05e-136:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.9e-138)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B));
	elseif (F <= 1.05e-136)
		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.9e-138)
		tmp = (-1.0 / sin(B)) - (x / B);
	elseif (F <= 1.05e-136)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.9e-138], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-136], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.9 \cdot 10^{-138}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.89999999999999973e-138

    1. Initial program 69.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 82.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 65.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Step-by-step derivation
      1. +-commutative65.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \left(-\frac{x}{B}\right)} \]
      2. div-inv65.4%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B}} + \left(-\frac{x}{B}\right) \]
      3. fma-define65.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, -\frac{x}{B}\right)} \]
      4. distribute-neg-frac265.4%

        \[\leadsto \mathsf{fma}\left(-1, \frac{1}{\sin B}, \color{blue}{\frac{x}{-B}}\right) \]
    6. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{x}{-B}\right)} \]
    7. Step-by-step derivation
      1. fma-undefine65.4%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} + \frac{x}{-B}} \]
      2. distribute-frac-neg265.4%

        \[\leadsto -1 \cdot \frac{1}{\sin B} + \color{blue}{\left(-\frac{x}{B}\right)} \]
      3. unsub-neg65.4%

        \[\leadsto \color{blue}{-1 \cdot \frac{1}{\sin B} - \frac{x}{B}} \]
      4. neg-mul-165.4%

        \[\leadsto \color{blue}{\left(-\frac{1}{\sin B}\right)} - \frac{x}{B} \]
      5. distribute-neg-frac65.4%

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{B} \]
      6. metadata-eval65.4%

        \[\leadsto \frac{\color{blue}{-1}}{\sin B} - \frac{x}{B} \]
    8. Simplified65.4%

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{B}} \]

    if -2.89999999999999973e-138 < F < 1.0499999999999999e-136

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 37.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 21.5%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around inf 48.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg48.1%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg248.1%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified48.1%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]

    if 1.0499999999999999e-136 < F

    1. Initial program 64.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 65.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 69.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Taylor expanded in B around 0 48.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification55.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.9 \cdot 10^{-138}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 36.0% accurate, 13.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-138}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+19} \lor \neg \left(F \leq 1.3 \cdot 10^{+65}\right) \land F \leq 5.1 \cdot 10^{+129}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -6.5e-138)
   (/ (- -1.0 x) B)
   (if (or (<= F 5e+19) (and (not (<= F 1.3e+65)) (<= F 5.1e+129)))
     (/ (- x) B)
     (/ 1.0 B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -6.5e-138) {
		tmp = (-1.0 - x) / B;
	} else if ((F <= 5e+19) || (!(F <= 1.3e+65) && (F <= 5.1e+129))) {
		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 (f <= (-6.5d-138)) then
        tmp = ((-1.0d0) - x) / b
    else if ((f <= 5d+19) .or. (.not. (f <= 1.3d+65)) .and. (f <= 5.1d+129)) 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 (F <= -6.5e-138) {
		tmp = (-1.0 - x) / B;
	} else if ((F <= 5e+19) || (!(F <= 1.3e+65) && (F <= 5.1e+129))) {
		tmp = -x / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -6.5e-138:
		tmp = (-1.0 - x) / B
	elif (F <= 5e+19) or (not (F <= 1.3e+65) and (F <= 5.1e+129)):
		tmp = -x / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -6.5e-138)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif ((F <= 5e+19) || (!(F <= 1.3e+65) && (F <= 5.1e+129)))
		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 (F <= -6.5e-138)
		tmp = (-1.0 - x) / B;
	elseif ((F <= 5e+19) || (~((F <= 1.3e+65)) && (F <= 5.1e+129)))
		tmp = -x / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -6.5e-138], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 5e+19], And[N[Not[LessEqual[F, 1.3e+65]], $MachinePrecision], LessEqual[F, 5.1e+129]]], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.5 \cdot 10^{-138}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 5 \cdot 10^{+19} \lor \neg \left(F \leq 1.3 \cdot 10^{+65}\right) \land F \leq 5.1 \cdot 10^{+129}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -6.4999999999999999e-138

    1. Initial program 69.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 82.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 65.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in B around 0 46.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. associate-*r/46.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in46.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval46.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-146.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
      5. unsub-neg46.6%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    7. Simplified46.6%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -6.4999999999999999e-138 < F < 5e19 or 1.30000000000000001e65 < F < 5.09999999999999996e129

    1. Initial program 97.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 44.5%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 25.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around inf 41.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg41.5%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg241.5%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified41.5%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]

    if 5e19 < F < 1.30000000000000001e65 or 5.09999999999999996e129 < F

    1. Initial program 42.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 68.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 76.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Taylor expanded in x around 0 41.5%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.5 \cdot 10^{-138}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{+19} \lor \neg \left(F \leq 1.3 \cdot 10^{+65}\right) \land F \leq 5.1 \cdot 10^{+129}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 42.2% accurate, 21.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-152}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4e-152)
   (/ (- -1.0 x) B)
   (if (<= F 1.05e-136) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4e-152) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.05e-136) {
		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 <= (-4d-152)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= 1.05d-136) 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 <= -4e-152) {
		tmp = (-1.0 - x) / B;
	} else if (F <= 1.05e-136) {
		tmp = -x / B;
	} else {
		tmp = (1.0 - x) / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -4e-152:
		tmp = (-1.0 - x) / B
	elif F <= 1.05e-136:
		tmp = -x / B
	else:
		tmp = (1.0 - x) / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -4e-152)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= 1.05e-136)
		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 <= -4e-152)
		tmp = (-1.0 - x) / B;
	elseif (F <= 1.05e-136)
		tmp = -x / B;
	else
		tmp = (1.0 - x) / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -4e-152], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.05e-136], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-152}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.00000000000000026e-152

    1. Initial program 69.8%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 82.2%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 65.4%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in B around 0 46.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    6. Step-by-step derivation
      1. associate-*r/46.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in46.6%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval46.6%

        \[\leadsto \frac{\color{blue}{-1} + -1 \cdot x}{B} \]
      4. neg-mul-146.6%

        \[\leadsto \frac{-1 + \color{blue}{\left(-x\right)}}{B} \]
      5. unsub-neg46.6%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    7. Simplified46.6%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -4.00000000000000026e-152 < F < 1.0499999999999999e-136

    1. Initial program 99.6%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 37.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 21.5%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around inf 48.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg48.1%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg248.1%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified48.1%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]

    if 1.0499999999999999e-136 < F

    1. Initial program 64.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 65.8%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 69.9%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Taylor expanded in B around 0 48.8%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{-152}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 30.1% accurate, 23.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{-116} \lor \neg \left(x \leq 9.6 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -2.9e-116) (not (<= x 9.6e-26))) (/ (- x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.9e-116) || !(x <= 9.6e-26)) {
		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.9d-116)) .or. (.not. (x <= 9.6d-26))) 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.9e-116) || !(x <= 9.6e-26)) {
		tmp = -x / B;
	} else {
		tmp = 1.0 / B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -2.9e-116) or not (x <= 9.6e-26):
		tmp = -x / B
	else:
		tmp = 1.0 / B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -2.9e-116) || !(x <= 9.6e-26))
		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.9e-116) || ~((x <= 9.6e-26)))
		tmp = -x / B;
	else
		tmp = 1.0 / B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.9e-116], N[Not[LessEqual[x, 9.6e-26]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-116} \lor \neg \left(x \leq 9.6 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{-x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.8999999999999998e-116 or 9.6000000000000004e-26 < x

    1. Initial program 83.5%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around -inf 82.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. Taylor expanded in B around 0 48.6%

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
    5. Taylor expanded in x around inf 50.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    6. Step-by-step derivation
      1. mul-1-neg50.7%

        \[\leadsto \color{blue}{-\frac{x}{B}} \]
      2. distribute-frac-neg250.7%

        \[\leadsto \color{blue}{\frac{x}{-B}} \]
    7. Simplified50.7%

      \[\leadsto \color{blue}{\frac{x}{-B}} \]

    if -2.8999999999999998e-116 < x < 9.6000000000000004e-26

    1. Initial program 64.1%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in F around inf 19.6%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    4. Taylor expanded in B around 0 28.4%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
    5. Taylor expanded in x around 0 19.3%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification35.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{-116} \lor \neg \left(x \leq 9.6 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 9.7% 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 74.3%

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in F around inf 47.2%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
  4. Taylor expanded in B around 0 56.3%

    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{1}{B}} \]
  5. Taylor expanded in x around 0 12.1%

    \[\leadsto \color{blue}{\frac{1}{B}} \]
  6. Add Preprocessing

Reproduce

?
herbie shell --seed 2024116 
(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))))))