VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.0% → 99.6%
Time: 17.3s
Alternatives: 21
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 21 alternatives:

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

Initial Program: 77.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1 \cdot 10^{+65}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 40000000:\\ \;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\sin B} \cdot \cos 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 -1e+65)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 40000000.0)
       (-
        (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)))
        (* (/ x (sin B)) (cos 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 <= -1e+65) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 40000000.0) {
		tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - ((x / sin(B)) * cos(B));
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -1e+65)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 40000000.0)
		tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - Float64(Float64(x / sin(B)) * cos(B)));
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+65], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 40000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod15.3%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      15. *-un-lft-identity39.5%

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

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

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv39.5%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub099.9%

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

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

        \[\leadsto \color{blue}{\frac{x}{-\tan B}} + \left(-\frac{1}{\sin B}\right) \]
      4. distribute-neg-frac99.9%

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

    if -9.9999999999999999e64 < F < 4e7

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

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

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

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

    if 4e7 < F

    1. Initial program 48.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times47.7%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval47.7%

        \[\leadsto \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      7. metadata-eval47.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt70.2%

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      16. rgt-mult-inverse99.8%

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

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

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

Alternative 2: 99.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 63.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 99.9%

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse62.4%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod14.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      14. rgt-mult-inverse37.9%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv37.9%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.9%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub099.9%

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

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

        \[\leadsto \color{blue}{\frac{x}{-\tan B}} + \left(-\frac{1}{\sin B}\right) \]
      4. distribute-neg-frac99.9%

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

    if -8.80000000000000058e62 < F < 4e7

    1. Initial program 99.5%

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

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

    if 4e7 < F

    1. Initial program 48.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times47.7%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval47.7%

        \[\leadsto \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      7. metadata-eval47.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt70.2%

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      16. rgt-mult-inverse99.8%

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

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

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

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

Alternative 3: 99.5% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse60.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod13.3%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      15. *-un-lft-identity39.5%

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

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

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv39.5%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub099.9%

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

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

        \[\leadsto \color{blue}{\frac{x}{-\tan B}} + \left(-\frac{1}{\sin B}\right) \]
      4. distribute-neg-frac99.9%

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.9%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative99.9%

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

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

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

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

    if -4e17 < F < 2

    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

    if 2 < F

    1. Initial program 48.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times47.7%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval47.7%

        \[\leadsto \sqrt{\frac{\color{blue}{1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      7. metadata-eval47.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt70.2%

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      16. rgt-mult-inverse99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+17}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2:\\ \;\;\;\;\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 4: 98.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod12.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      14. rgt-mult-inverse37.8%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv37.8%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.8%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub099.5%

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.5%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg299.5%

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

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

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

    if -1.75 < F < 1.42e-12

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

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

    if 1.42e-12 < F

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times46.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval46.4%

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times46.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt69.9%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - x \cdot \frac{1}{\tan B} \]
      17. un-div-inv98.6%

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

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

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

Alternative 5: 98.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;\frac{F \cdot \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.4199999999999999

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod12.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      14. rgt-mult-inverse37.8%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv37.8%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.8%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub099.5%

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.5%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg299.5%

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

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

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

    if -1.4199999999999999 < F < 1.42e-12

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

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

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

    if 1.42e-12 < F

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times46.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval46.4%

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times46.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt69.9%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - x \cdot \frac{1}{\tan B} \]
      17. un-div-inv98.6%

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

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

Alternative 6: 98.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;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.4199999999999999

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod12.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      14. rgt-mult-inverse37.8%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv37.8%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.8%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub099.5%

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.5%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative99.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg299.5%

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

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

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

    if -1.4199999999999999 < F < 1.42e-12

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

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

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

    if 1.42e-12 < F

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times46.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval46.4%

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times46.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt69.9%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - x \cdot \frac{1}{\tan B} \]
      17. un-div-inv98.6%

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

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

Alternative 7: 91.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -1.8 \cdot 10^{-6}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\ \;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - 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.8e-6)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F -7.5e-78)
       (- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
       (if (<= F 1.42e-12)
         (- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 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.8e-6) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= -7.5e-78) {
		tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
	} else if (F <= 1.42e-12) {
		tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.8d-6)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= (-7.5d-78)) then
        tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
    else if (f <= 1.42d-12) then
        tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / 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.8e-6) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= -7.5e-78) {
		tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
	} else if (F <= 1.42e-12) {
		tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.8e-6:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= -7.5e-78:
		tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B)
	elif F <= 1.42e-12:
		tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.8e-6)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= -7.5e-78)
		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 <= 1.42e-12)
		tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / 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.8e-6)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= -7.5e-78)
		tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B);
	elseif (F <= 1.42e-12)
		tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.8e-6], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -7.5e-78], 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, 1.42e-12], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / 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.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\

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

\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - t\_0\\

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


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

    1. Initial program 71.3%

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse60.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod13.7%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} \]
      12. add-sqr-sqrt35.4%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      15. *-un-lft-identity38.5%

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

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

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv38.5%

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

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

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.4%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg299.4%

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

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

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

    if -1.79999999999999992e-6 < F < -7.50000000000000041e-78

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

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

    if -7.50000000000000041e-78 < F < 1.42e-12

    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. 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 F around 0 99.7%

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

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

    if 1.42e-12 < F

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times46.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval46.4%

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times46.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt69.9%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - x \cdot \frac{1}{\tan B} \]
      17. un-div-inv98.6%

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

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

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

Alternative 8: 90.6% accurate, 1.4× speedup?

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

\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - t\_0\\

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


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

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod14.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv39.0%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub097.5%

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval97.5%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative97.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg297.5%

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

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

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

    if -7.79999999999999982e-41 < F < 1.42e-12

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

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

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

    if 1.42e-12 < F

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times46.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval46.4%

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times46.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt69.9%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - x \cdot \frac{1}{\tan B} \]
      17. un-div-inv98.6%

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

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

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

Alternative 9: 69.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -7 \cdot 10^{+99}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -182:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.20000000000000008e133 or -6.9999999999999995e99 < F < -182

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

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

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

    if -8.20000000000000008e133 < F < -6.9999999999999995e99

    1. Initial program 82.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 99.9%

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

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

    if -182 < F < 1.6999999999999999e-145

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

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

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

        \[\leadsto -1 \cdot \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      2. *-un-lft-identity78.7%

        \[\leadsto -1 \cdot \frac{\cos B \cdot x}{\color{blue}{1 \cdot \sin B}} \]
      3. times-frac78.8%

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

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

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

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

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

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

    if 1.6999999999999999e-145 < F

    1. Initial program 63.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 66.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.2 \cdot 10^{+133}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -182:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-145}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 90.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -7.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\ \;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{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 -7.8e-41)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 1.42e-12)
       (- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F 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 <= -7.8e-41) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 1.42e-12) {
		tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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 <= (-7.8d-41)) then
        tmp = ((-1.0d0) / sin(b)) - t_0
    else if (f <= 1.42d-12) then
        tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / 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 <= -7.8e-41) {
		tmp = (-1.0 / Math.sin(B)) - t_0;
	} else if (F <= 1.42e-12) {
		tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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 <= -7.8e-41:
		tmp = (-1.0 / math.sin(B)) - t_0
	elif F <= 1.42e-12:
		tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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 <= -7.8e-41)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 1.42e-12)
		tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / 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 <= -7.8e-41)
		tmp = (-1.0 / sin(B)) - t_0;
	elseif (F <= 1.42e-12)
		tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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, -7.8e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42e-12], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{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 < -7.79999999999999982e-41

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod14.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv39.0%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub097.5%

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval97.5%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative97.5%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg297.5%

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

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

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

    if -7.79999999999999982e-41 < F < 1.42e-12

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

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

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

    if 1.42e-12 < F

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times46.4%

        \[\leadsto \sqrt{\color{blue}{\frac{-1 \cdot -1}{\sin B \cdot \sin B}}} - x \cdot \frac{1}{\tan B} \]
      6. metadata-eval46.4%

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times46.4%

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt69.9%

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

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

        \[\leadsto \frac{\color{blue}{1}}{\sin B} - x \cdot \frac{1}{\tan B} \]
      17. un-div-inv98.6%

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

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

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

Alternative 11: 83.8% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;F \leq 2 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{x}{\sin B}}{\frac{-1}{\cos B}}\\

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


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

    1. Initial program 74.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 91.2%

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse57.0%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod14.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.0%

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

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

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval91.3%

        \[\leadsto \frac{x}{-\tan B} + \frac{\color{blue}{-1}}{\sin B} \]
    7. Simplified91.3%

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative91.3%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg291.3%

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

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

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

    if -2.3999999999999999e-77 < F < 1.99999999999999986e-39

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

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

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

        \[\leadsto -1 \cdot \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      2. *-un-lft-identity84.7%

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{\cos B}{1} \cdot \frac{x}{\sin B}\right)} \]
    6. Applied egg-rr84.7%

      \[\leadsto -1 \cdot \color{blue}{\left(\frac{\cos B}{1} \cdot \frac{x}{\sin B}\right)} \]
    7. Step-by-step derivation
      1. clear-num84.7%

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

        \[\leadsto -1 \cdot \color{blue}{\frac{1 \cdot \frac{x}{\sin B}}{\frac{1}{\cos B}}} \]
      3. *-un-lft-identity84.8%

        \[\leadsto -1 \cdot \frac{\color{blue}{\frac{x}{\sin B}}}{\frac{1}{\cos B}} \]
    8. Applied egg-rr84.8%

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

    if 1.99999999999999986e-39 < F

    1. Initial program 54.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 42.8%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times43.9%

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

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times43.9%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      9. rgt-mult-inverse43.9%

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

        \[\leadsto \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      11. rgt-mult-inverse36.7%

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt67.2%

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      16. rgt-mult-inverse93.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{-77}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-39}:\\ \;\;\;\;\frac{\frac{x}{\sin B}}{\frac{-1}{\cos B}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 83.8% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 74.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 91.3%

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse57.4%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod14.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      15. *-un-lft-identity37.6%

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv37.6%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.6%

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

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

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval91.3%

        \[\leadsto \frac{x}{-\tan B} + \frac{\color{blue}{-1}}{\sin B} \]
    7. Simplified91.3%

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative91.3%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg291.3%

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

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

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

    if -3e-79 < F < 3.5e-39

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

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

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

        \[\leadsto -1 \cdot \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      2. *-un-lft-identity84.5%

        \[\leadsto -1 \cdot \frac{\cos B \cdot x}{\color{blue}{1 \cdot \sin B}} \]
      3. times-frac84.6%

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

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

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

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

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

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

    if 3.5e-39 < F

    1. Initial program 54.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 42.8%

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{-1}{\sin B} \cdot \frac{-1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      5. frac-times43.9%

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

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

        \[\leadsto \sqrt{\frac{\color{blue}{1 \cdot 1}}{\sin B \cdot \sin B}} - x \cdot \frac{1}{\tan B} \]
      8. frac-times43.9%

        \[\leadsto \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} - x \cdot \frac{1}{\tan B} \]
      9. rgt-mult-inverse43.9%

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

        \[\leadsto \sqrt{\color{blue}{\left(\frac{F}{\sin B} \cdot \frac{1}{F}\right)} \cdot \frac{1}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      11. rgt-mult-inverse36.7%

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

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

        \[\leadsto \color{blue}{\sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}} \cdot \sqrt{\frac{F}{\sin B} \cdot \frac{1}{F}}} - x \cdot \frac{1}{\tan B} \]
      14. add-sqr-sqrt67.2%

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

        \[\leadsto \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} - x \cdot \frac{1}{\tan B} \]
      16. rgt-mult-inverse93.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-79}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-39}:\\ \;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 75.5% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 74.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 91.3%

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse57.4%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod14.9%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      15. *-un-lft-identity37.6%

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv37.6%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.6%

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

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

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval91.3%

        \[\leadsto \frac{x}{-\tan B} + \frac{\color{blue}{-1}}{\sin B} \]
    7. Simplified91.3%

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Step-by-step derivation
      1. +-commutative91.3%

        \[\leadsto \color{blue}{\frac{-1}{\sin B} + \frac{x}{-\tan B}} \]
      2. distribute-frac-neg291.3%

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

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

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

    if -5.60000000000000023e-79 < F < 1.6999999999999999e-145

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

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

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

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

        \[\leadsto -1 \cdot \frac{\cos B \cdot x}{\color{blue}{1 \cdot \sin B}} \]
      3. times-frac86.8%

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

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

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

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

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

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

    if 1.6999999999999999e-145 < F

    1. Initial program 63.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 66.9%

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

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

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

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

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

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

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

Alternative 14: 69.6% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;F \leq -7.5 \cdot 10^{+99}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\

\mathbf{elif}\;F \leq -2.15:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -4.8000000000000004e127 or -7.49999999999999963e99 < F < -2.14999999999999991

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

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

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

    if -4.8000000000000004e127 < F < -7.49999999999999963e99

    1. Initial program 82.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 99.9%

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

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

    if -2.14999999999999991 < F < 1.3e-145

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

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

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

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

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot78.5%

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

      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/78.8%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      2. *-rgt-identity78.8%

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

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

    if 1.3e-145 < F

    1. Initial program 63.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 66.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4.8 \cdot 10^{+127}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -7.5 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -2.15:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-145}:\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 62.8% accurate, 2.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -4.10000000000000004e133 or -7.9999999999999997e99 < F < -22.5

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

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

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

    if -4.10000000000000004e133 < F < -7.9999999999999997e99

    1. Initial program 82.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 99.9%

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

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

    if -22.5 < F

    1. Initial program 81.4%

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. clear-num64.4%

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot64.4%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
    6. Applied egg-rr64.4%

      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/64.6%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      2. *-rgt-identity64.6%

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

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

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

Alternative 16: 57.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 6.6 \cdot 10^{-177}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -1.2e-74) (not (<= x 6.6e-177)))
   (/ x (- (tan B)))
   (/ -1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.2e-74) || !(x <= 6.6e-177)) {
		tmp = x / -tan(B);
	} else {
		tmp = -1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-1.2d-74)) .or. (.not. (x <= 6.6d-177))) then
        tmp = x / -tan(b)
    else
        tmp = (-1.0d0) / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -1.2e-74) || !(x <= 6.6e-177)) {
		tmp = x / -Math.tan(B);
	} else {
		tmp = -1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -1.2e-74) or not (x <= 6.6e-177):
		tmp = x / -math.tan(B)
	else:
		tmp = -1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -1.2e-74) || !(x <= 6.6e-177))
		tmp = Float64(x / Float64(-tan(B)));
	else
		tmp = Float64(-1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -1.2e-74) || ~((x <= 6.6e-177)))
		tmp = x / -tan(B);
	else
		tmp = -1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.2e-74], N[Not[LessEqual[x, 6.6e-177]], $MachinePrecision]], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 6.6 \cdot 10^{-177}\right):\\
\;\;\;\;\frac{x}{-\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1999999999999999e-74 or 6.5999999999999999e-177 < x

    1. Initial program 83.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 69.6%

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

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

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

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot77.9%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
    6. Applied egg-rr77.9%

      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/78.1%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      2. *-rgt-identity78.1%

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

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

    if -1.1999999999999999e-74 < x < 6.5999999999999999e-177

    1. Initial program 68.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 44.0%

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse26.0%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod3.4%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      14. rgt-mult-inverse21.4%

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      15. *-un-lft-identity21.4%

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv21.4%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv21.4%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub044.0%

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

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

        \[\leadsto \color{blue}{\frac{x}{-\tan B}} + \left(-\frac{1}{\sin B}\right) \]
      4. distribute-neg-frac44.0%

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval44.0%

        \[\leadsto \frac{x}{-\tan B} + \frac{\color{blue}{-1}}{\sin B} \]
    7. Simplified44.0%

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Taylor expanded in x around 0 44.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 6.6 \cdot 10^{-177}\right):\\ \;\;\;\;\frac{x}{-\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 63.1% accurate, 2.9× speedup?

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

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

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


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

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

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

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

    if -0.35499999999999998 < F

    1. Initial program 81.4%

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

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{\cos B}{\sin B}\right)} \]
      2. clear-num64.4%

        \[\leadsto -1 \cdot \left(x \cdot \color{blue}{\frac{1}{\frac{\sin B}{\cos B}}}\right) \]
      3. tan-quot64.4%

        \[\leadsto -1 \cdot \left(x \cdot \frac{1}{\color{blue}{\tan B}}\right) \]
    6. Applied egg-rr64.4%

      \[\leadsto -1 \cdot \color{blue}{\left(x \cdot \frac{1}{\tan B}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/64.6%

        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot 1}{\tan B}} \]
      2. *-rgt-identity64.6%

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

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

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

Alternative 18: 38.9% accurate, 3.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod12.7%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot \frac{1}{F}}{\sin B}} \]
      14. rgt-mult-inverse37.8%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv37.8%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv37.8%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub099.5%

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval99.5%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Taylor expanded in x around 0 62.5%

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

    if -5.5 < F

    1. Initial program 81.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -5.5:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 37.2% accurate, 3.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \sqrt{\color{blue}{\frac{1}{\sin B} \cdot \frac{1}{\sin B}}} \]
      7. rgt-mult-inverse60.4%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)}} \]
      11. sqrt-unprod13.5%

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      15. *-un-lft-identity38.1%

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\left(--1\right)} \cdot \frac{1}{\sin B} \]
      17. cancel-sign-sub-inv38.1%

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) - -1 \cdot \frac{1}{\sin B}} \]
      18. div-inv38.1%

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

      \[\leadsto \color{blue}{0 - \left(\frac{x}{\tan B} + \frac{1}{\sin B}\right)} \]
    6. Step-by-step derivation
      1. neg-sub098.5%

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

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

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

        \[\leadsto \frac{x}{-\tan B} + \color{blue}{\frac{-1}{\sin B}} \]
      5. metadata-eval98.5%

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

      \[\leadsto \color{blue}{\frac{x}{-\tan B} + \frac{-1}{\sin B}} \]
    8. Taylor expanded in x around 0 61.2%

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

    if -1.4499999999999999e-10 < F

    1. Initial program 81.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 39.6%

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

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

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

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

Alternative 20: 35.6% accurate, 32.3× speedup?

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

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

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


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

    1. Initial program 74.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 91.2%

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

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

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

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

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

    if -2.3999999999999999e-77 < F

    1. Initial program 79.9%

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

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

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

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

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

Alternative 21: 28.8% accurate, 81.0× speedup?

\[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
	return -x / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -x / b
end function
public static double code(double F, double B, double x) {
	return -x / B;
}
def code(F, B, x):
	return -x / B
function code(F, B, x)
	return Float64(Float64(-x) / B)
end
function tmp = code(F, B, x)
	tmp = -x / B;
end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-x}{B}
\end{array}
Derivation
  1. Initial program 77.8%

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

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

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

    \[\leadsto -1 \cdot \color{blue}{\frac{x}{B}} \]
  6. Final simplification31.0%

    \[\leadsto \frac{-x}{B} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024090 
(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))))))