VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.4% → 99.5%
Time: 21.4s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 76.4% 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.5% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 52.8%

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. 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}} \]

    if -2.30000000000000017e60 < F < 0.048000000000000001

    1. Initial program 98.6%

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

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

    if 0.048000000000000001 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

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

    if -135000 < F < 0.048000000000000001

    1. Initial program 99.3%

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

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

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

    if 0.048000000000000001 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.0% 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.46:\\ \;\;\;\;\frac{-1}{\sin B} - t\_1\\ \mathbf{elif}\;F \leq 0.048:\\ \;\;\;\;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.46)
     (- (/ -1.0 (sin B)) t_1)
     (if (<= F 0.048)
       (- (* 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.46) {
		tmp = (-1.0 / sin(B)) - t_1;
	} else if (F <= 0.048) {
		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.46d0)) then
        tmp = ((-1.0d0) / sin(b)) - t_1
    else if (f <= 0.048d0) 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.46) {
		tmp = (-1.0 / Math.sin(B)) - t_1;
	} else if (F <= 0.048) {
		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.46:
		tmp = (-1.0 / math.sin(B)) - t_1
	elif F <= 0.048:
		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.46)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_1);
	elseif (F <= 0.048)
		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.46)
		tmp = (-1.0 / sin(B)) - t_1;
	elseif (F <= 0.048)
		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.46], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 0.048], 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.46:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\

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

    1. Initial program 60.0%

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

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

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

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

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

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

    if -1.46 < F < 0.048000000000000001

    1. Initial program 99.3%

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

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

    if 0.048000000000000001 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 60.4%

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

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

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

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

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

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

    if -0.00309999999999999989 < F < 0.048000000000000001

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.048000000000000001 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 0.048:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}} - t\_0\\

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


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

    1. Initial program 60.0%

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

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

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

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

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

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

    if -1.44999999999999996 < F < 0.048000000000000001

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.048000000000000001 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 92.6% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -2.15 \cdot 10^{-68}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\

\mathbf{elif}\;F \leq 0.048:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - t\_1\\

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


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

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

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

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

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

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

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

    if -112000 < F < -2.15000000000000005e-68

    1. Initial program 99.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 B around 0 87.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 -2.15000000000000005e-68 < F < 0.048000000000000001

    1. Initial program 99.4%

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

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

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

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

    if 0.048000000000000001 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 92.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 0.043:\\
\;\;\;\;\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 4 regimes
  2. if F < -55000

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

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

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

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

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

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

    if -55000 < F < -4.8999999999999998e-69

    1. Initial program 99.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 B around 0 87.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 -4.8999999999999998e-69 < F < 0.042999999999999997

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 0.042999999999999997 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -55000:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.9 \cdot 10^{-69}:\\ \;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 0.043:\\ \;\;\;\;\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 8: 70.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -2.7 \cdot 10^{+96}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -3.1 \cdot 10^{+57}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 1.9:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+109} \lor \neg \left(F \leq 4.5 \cdot 10^{+243}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -2.7e+96)
     t_0
     (if (<= F -3.1e+57)
       (- (/ -1.0 B) (/ x (tan B)))
       (if (<= F -3.7e-35)
         t_0
         (if (<= F 1.9)
           (* (- x) (/ (cos B) (sin B)))
           (if (or (<= F 4.3e+109) (not (<= F 4.5e+243)))
             (- (/ F (* F (sin B))) (/ x B))
             (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -2.7e+96) {
		tmp = t_0;
	} else if (F <= -3.1e+57) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= -3.7e-35) {
		tmp = t_0;
	} else if (F <= 1.9) {
		tmp = -x * (cos(B) / sin(B));
	} else if ((F <= 4.3e+109) || !(F <= 4.5e+243)) {
		tmp = (F / (F * sin(B))) - (x / 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) :: t_0
    real(8) :: tmp
    t_0 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-2.7d+96)) then
        tmp = t_0
    else if (f <= (-3.1d+57)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= (-3.7d-35)) then
        tmp = t_0
    else if (f <= 1.9d0) then
        tmp = -x * (cos(b) / sin(b))
    else if ((f <= 4.3d+109) .or. (.not. (f <= 4.5d+243))) then
        tmp = (f / (f * sin(b))) - (x / 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 t_0 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -2.7e+96) {
		tmp = t_0;
	} else if (F <= -3.1e+57) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= -3.7e-35) {
		tmp = t_0;
	} else if (F <= 1.9) {
		tmp = -x * (Math.cos(B) / Math.sin(B));
	} else if ((F <= 4.3e+109) || !(F <= 4.5e+243)) {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -2.7e+96:
		tmp = t_0
	elif F <= -3.1e+57:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= -3.7e-35:
		tmp = t_0
	elif F <= 1.9:
		tmp = -x * (math.cos(B) / math.sin(B))
	elif (F <= 4.3e+109) or not (F <= 4.5e+243):
		tmp = (F / (F * math.sin(B))) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -2.7e+96)
		tmp = t_0;
	elseif (F <= -3.1e+57)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= -3.7e-35)
		tmp = t_0;
	elseif (F <= 1.9)
		tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B)));
	elseif ((F <= 4.3e+109) || !(F <= 4.5e+243))
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / 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)
	t_0 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -2.7e+96)
		tmp = t_0;
	elseif (F <= -3.1e+57)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= -3.7e-35)
		tmp = t_0;
	elseif (F <= 1.9)
		tmp = -x * (cos(B) / sin(B));
	elseif ((F <= 4.3e+109) || ~((F <= 4.5e+243)))
		tmp = (F / (F * sin(B))) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / 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, -2.7e+96], t$95$0, If[LessEqual[F, -3.1e+57], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.7e-35], t$95$0, If[LessEqual[F, 1.9], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.3e+109], N[Not[LessEqual[F, 4.5e+243]], $MachinePrecision]], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / 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}
t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+96}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 4.3 \cdot 10^{+109} \lor \neg \left(F \leq 4.5 \cdot 10^{+243}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -2.70000000000000022e96 or -3.10000000000000013e57 < F < -3.6999999999999999e-35

    1. Initial program 58.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 90.9%

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

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

    if -2.70000000000000022e96 < F < -3.10000000000000013e57

    1. Initial program 99.1%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. 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}} \]
    6. Taylor expanded in B around 0 99.9%

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

    if -3.6999999999999999e-35 < F < 1.8999999999999999

    1. Initial program 99.3%

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

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

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{\cos B}{\sin B}} \]
      3. distribute-lft-neg-in70.5%

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

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

    if 1.8999999999999999 < F < 4.3000000000000001e109 or 4.5e243 < F

    1. Initial program 51.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 73.7%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    5. Step-by-step derivation
      1. un-div-inv61.1%

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

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

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

    if 4.3000000000000001e109 < F < 4.5e243

    1. Initial program 60.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+96}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -3.1 \cdot 10^{+57}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.9:\\ \;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+109} \lor \neg \left(F \leq 4.5 \cdot 10^{+243}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -3.1 \cdot 10^{+96}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -1.12 \cdot 10^{+60}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.6 \cdot 10^{-36}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 28:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 3.05 \cdot 10^{+108} \lor \neg \left(F \leq 7.2 \cdot 10^{+242}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -3.1e+96)
     t_0
     (if (<= F -1.12e+60)
       (- (/ -1.0 B) (/ x (tan B)))
       (if (<= F -4.6e-36)
         t_0
         (if (<= F 28.0)
           (/ (* x (cos B)) (- (sin B)))
           (if (or (<= F 3.05e+108) (not (<= F 7.2e+242)))
             (- (/ F (* F (sin B))) (/ x B))
             (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -3.1e+96) {
		tmp = t_0;
	} else if (F <= -1.12e+60) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= -4.6e-36) {
		tmp = t_0;
	} else if (F <= 28.0) {
		tmp = (x * cos(B)) / -sin(B);
	} else if ((F <= 3.05e+108) || !(F <= 7.2e+242)) {
		tmp = (F / (F * sin(B))) - (x / 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) :: t_0
    real(8) :: tmp
    t_0 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-3.1d+96)) then
        tmp = t_0
    else if (f <= (-1.12d+60)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= (-4.6d-36)) then
        tmp = t_0
    else if (f <= 28.0d0) then
        tmp = (x * cos(b)) / -sin(b)
    else if ((f <= 3.05d+108) .or. (.not. (f <= 7.2d+242))) then
        tmp = (f / (f * sin(b))) - (x / 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 t_0 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -3.1e+96) {
		tmp = t_0;
	} else if (F <= -1.12e+60) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= -4.6e-36) {
		tmp = t_0;
	} else if (F <= 28.0) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if ((F <= 3.05e+108) || !(F <= 7.2e+242)) {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -3.1e+96:
		tmp = t_0
	elif F <= -1.12e+60:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= -4.6e-36:
		tmp = t_0
	elif F <= 28.0:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif (F <= 3.05e+108) or not (F <= 7.2e+242):
		tmp = (F / (F * math.sin(B))) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -3.1e+96)
		tmp = t_0;
	elseif (F <= -1.12e+60)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= -4.6e-36)
		tmp = t_0;
	elseif (F <= 28.0)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif ((F <= 3.05e+108) || !(F <= 7.2e+242))
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / 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)
	t_0 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -3.1e+96)
		tmp = t_0;
	elseif (F <= -1.12e+60)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= -4.6e-36)
		tmp = t_0;
	elseif (F <= 28.0)
		tmp = (x * cos(B)) / -sin(B);
	elseif ((F <= 3.05e+108) || ~((F <= 7.2e+242)))
		tmp = (F / (F * sin(B))) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / 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, -3.1e+96], t$95$0, If[LessEqual[F, -1.12e+60], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.6e-36], t$95$0, If[LessEqual[F, 28.0], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 3.05e+108], N[Not[LessEqual[F, 7.2e+242]], $MachinePrecision]], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / 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}
t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -3.1 \cdot 10^{+96}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq -4.6 \cdot 10^{-36}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq 28:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 3.05 \cdot 10^{+108} \lor \neg \left(F \leq 7.2 \cdot 10^{+242}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -3.0999999999999998e96 or -1.1199999999999999e60 < F < -4.59999999999999993e-36

    1. Initial program 58.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 90.9%

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

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

    if -3.0999999999999998e96 < F < -1.1199999999999999e60

    1. Initial program 99.1%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. 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}} \]
    6. Taylor expanded in B around 0 99.9%

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

    if -4.59999999999999993e-36 < F < 28

    1. Initial program 99.3%

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

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

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

    if 28 < F < 3.0500000000000002e108 or 7.19999999999999989e242 < F

    1. Initial program 51.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 73.7%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    5. Step-by-step derivation
      1. un-div-inv61.1%

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

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

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

    if 3.0500000000000002e108 < F < 7.19999999999999989e242

    1. Initial program 60.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{+96}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.12 \cdot 10^{+60}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.6 \cdot 10^{-36}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 28:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 3.05 \cdot 10^{+108} \lor \neg \left(F \leq 7.2 \cdot 10^{+242}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 91.7% accurate, 1.4× speedup?

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

\mathbf{elif}\;F \leq 0.028:\\
\;\;\;\;\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 < -2.99999999999999974e-4

    1. Initial program 60.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 96.5%

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

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

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

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

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

    if -2.99999999999999974e-4 < F < 0.0280000000000000006

    1. Initial program 99.3%

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

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

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

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

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

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

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

    if 0.0280000000000000006 < F

    1. Initial program 56.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 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;F \leq 7.1 \cdot 10^{-37}:\\
\;\;\;\;\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 < -7.5999999999999995e-58

    1. Initial program 64.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 91.1%

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

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

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

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

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

    if -7.5999999999999995e-58 < F < 7.09999999999999978e-37

    1. Initial program 99.4%

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

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

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

    if 7.09999999999999978e-37 < F

    1. Initial program 60.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 77.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{-58}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 20:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+109} \lor \neg \left(F \leq 8 \cdot 10^{+242}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -7.6e-58)
   (- (/ -1.0 (sin B)) (/ x (tan B)))
   (if (<= F 20.0)
     (/ (* x (cos B)) (- (sin B)))
     (if (or (<= F 1.55e+109) (not (<= F 8e+242)))
       (- (/ F (* F (sin B))) (/ x B))
       (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -7.6e-58) {
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	} else if (F <= 20.0) {
		tmp = (x * cos(B)) / -sin(B);
	} else if ((F <= 1.55e+109) || !(F <= 8e+242)) {
		tmp = (F / (F * sin(B))) - (x / 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 <= (-7.6d-58)) then
        tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
    else if (f <= 20.0d0) then
        tmp = (x * cos(b)) / -sin(b)
    else if ((f <= 1.55d+109) .or. (.not. (f <= 8d+242))) then
        tmp = (f / (f * sin(b))) - (x / 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 <= -7.6e-58) {
		tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
	} else if (F <= 20.0) {
		tmp = (x * Math.cos(B)) / -Math.sin(B);
	} else if ((F <= 1.55e+109) || !(F <= 8e+242)) {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -7.6e-58:
		tmp = (-1.0 / math.sin(B)) - (x / math.tan(B))
	elif F <= 20.0:
		tmp = (x * math.cos(B)) / -math.sin(B)
	elif (F <= 1.55e+109) or not (F <= 8e+242):
		tmp = (F / (F * math.sin(B))) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -7.6e-58)
		tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B)));
	elseif (F <= 20.0)
		tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B)));
	elseif ((F <= 1.55e+109) || !(F <= 8e+242))
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / 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 <= -7.6e-58)
		tmp = (-1.0 / sin(B)) - (x / tan(B));
	elseif (F <= 20.0)
		tmp = (x * cos(B)) / -sin(B);
	elseif ((F <= 1.55e+109) || ~((F <= 8e+242)))
		tmp = (F / (F * sin(B))) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -7.6e-58], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 20.0], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 1.55e+109], N[Not[LessEqual[F, 8e+242]], $MachinePrecision]], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / 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 -7.6 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\

\mathbf{elif}\;F \leq 20:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\

\mathbf{elif}\;F \leq 1.55 \cdot 10^{+109} \lor \neg \left(F \leq 8 \cdot 10^{+242}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


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

    1. Initial program 64.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 91.1%

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

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

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

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

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

    if -7.5999999999999995e-58 < F < 20

    1. Initial program 99.3%

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

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

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

    if 20 < F < 1.54999999999999996e109 or 8.00000000000000041e242 < F

    1. Initial program 51.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 73.7%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    5. Step-by-step derivation
      1. un-div-inv61.1%

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

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

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

    if 1.54999999999999996e109 < F < 8.00000000000000041e242

    1. Initial program 60.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{-58}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 20:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1.55 \cdot 10^{+109} \lor \neg \left(F \leq 8 \cdot 10^{+242}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.9% accurate, 2.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{if}\;F \leq -8.5 \cdot 10^{+96}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{+60}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{1}{F}}{\frac{B}{F}} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+109} \lor \neg \left(F \leq 3.3 \cdot 10^{+242}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ -1.0 (sin B)) (/ x B))))
   (if (<= F -8.5e+96)
     t_0
     (if (<= F -1.05e+60)
       (- (/ -1.0 B) (/ x (tan B)))
       (if (<= F -3.7e-35)
         t_0
         (if (<= F 2.35e+39)
           (- (/ (/ 1.0 F) (/ B F)) (* x (/ 1.0 (tan B))))
           (if (or (<= F 4.3e+109) (not (<= F 3.3e+242)))
             (- (/ F (* F (sin B))) (/ x B))
             (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))))))
double code(double F, double B, double x) {
	double t_0 = (-1.0 / sin(B)) - (x / B);
	double tmp;
	if (F <= -8.5e+96) {
		tmp = t_0;
	} else if (F <= -1.05e+60) {
		tmp = (-1.0 / B) - (x / tan(B));
	} else if (F <= -3.7e-35) {
		tmp = t_0;
	} else if (F <= 2.35e+39) {
		tmp = ((1.0 / F) / (B / F)) - (x * (1.0 / tan(B)));
	} else if ((F <= 4.3e+109) || !(F <= 3.3e+242)) {
		tmp = (F / (F * sin(B))) - (x / 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) :: t_0
    real(8) :: tmp
    t_0 = ((-1.0d0) / sin(b)) - (x / b)
    if (f <= (-8.5d+96)) then
        tmp = t_0
    else if (f <= (-1.05d+60)) then
        tmp = ((-1.0d0) / b) - (x / tan(b))
    else if (f <= (-3.7d-35)) then
        tmp = t_0
    else if (f <= 2.35d+39) then
        tmp = ((1.0d0 / f) / (b / f)) - (x * (1.0d0 / tan(b)))
    else if ((f <= 4.3d+109) .or. (.not. (f <= 3.3d+242))) then
        tmp = (f / (f * sin(b))) - (x / 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 t_0 = (-1.0 / Math.sin(B)) - (x / B);
	double tmp;
	if (F <= -8.5e+96) {
		tmp = t_0;
	} else if (F <= -1.05e+60) {
		tmp = (-1.0 / B) - (x / Math.tan(B));
	} else if (F <= -3.7e-35) {
		tmp = t_0;
	} else if (F <= 2.35e+39) {
		tmp = ((1.0 / F) / (B / F)) - (x * (1.0 / Math.tan(B)));
	} else if ((F <= 4.3e+109) || !(F <= 3.3e+242)) {
		tmp = (F / (F * Math.sin(B))) - (x / B);
	} else {
		tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = (-1.0 / math.sin(B)) - (x / B)
	tmp = 0
	if F <= -8.5e+96:
		tmp = t_0
	elif F <= -1.05e+60:
		tmp = (-1.0 / B) - (x / math.tan(B))
	elif F <= -3.7e-35:
		tmp = t_0
	elif F <= 2.35e+39:
		tmp = ((1.0 / F) / (B / F)) - (x * (1.0 / math.tan(B)))
	elif (F <= 4.3e+109) or not (F <= 3.3e+242):
		tmp = (F / (F * math.sin(B))) - (x / B)
	else:
		tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B)
	return tmp
function code(F, B, x)
	t_0 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B))
	tmp = 0.0
	if (F <= -8.5e+96)
		tmp = t_0;
	elseif (F <= -1.05e+60)
		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
	elseif (F <= -3.7e-35)
		tmp = t_0;
	elseif (F <= 2.35e+39)
		tmp = Float64(Float64(Float64(1.0 / F) / Float64(B / F)) - Float64(x * Float64(1.0 / tan(B))));
	elseif ((F <= 4.3e+109) || !(F <= 3.3e+242))
		tmp = Float64(Float64(F / Float64(F * sin(B))) - Float64(x / 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)
	t_0 = (-1.0 / sin(B)) - (x / B);
	tmp = 0.0;
	if (F <= -8.5e+96)
		tmp = t_0;
	elseif (F <= -1.05e+60)
		tmp = (-1.0 / B) - (x / tan(B));
	elseif (F <= -3.7e-35)
		tmp = t_0;
	elseif (F <= 2.35e+39)
		tmp = ((1.0 / F) / (B / F)) - (x * (1.0 / tan(B)));
	elseif ((F <= 4.3e+109) || ~((F <= 3.3e+242)))
		tmp = (F / (F * sin(B))) - (x / B);
	else
		tmp = (x * (-1.0 / tan(B))) + (1.0 / 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, -8.5e+96], t$95$0, If[LessEqual[F, -1.05e+60], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.7e-35], t$95$0, If[LessEqual[F, 2.35e+39], N[(N[(N[(1.0 / F), $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.3e+109], N[Not[LessEqual[F, 3.3e+242]], $MachinePrecision]], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / 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}
t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+96}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;F \leq 4.3 \cdot 10^{+109} \lor \neg \left(F \leq 3.3 \cdot 10^{+242}\right):\\
\;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if F < -8.50000000000000025e96 or -1.0500000000000001e60 < F < -3.6999999999999999e-35

    1. Initial program 58.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 90.9%

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

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

    if -8.50000000000000025e96 < F < -1.0500000000000001e60

    1. Initial program 99.1%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. 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}} \]
    6. Taylor expanded in B around 0 99.9%

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

    if -3.6999999999999999e-35 < F < 2.35e39

    1. Initial program 99.3%

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

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

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

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

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

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

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

    if 2.35e39 < F < 4.3000000000000001e109 or 3.30000000000000023e242 < F

    1. Initial program 46.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 70.6%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    5. Step-by-step derivation
      1. un-div-inv59.1%

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

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

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

    if 4.3000000000000001e109 < F < 3.30000000000000023e242

    1. Initial program 60.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{+96}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{+60}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 2.35 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{1}{F}}{\frac{B}{F}} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 4.3 \cdot 10^{+109} \lor \neg \left(F \leq 3.3 \cdot 10^{+242}\right):\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 60.8% accurate, 2.3× speedup?

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

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

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

\mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq -2.7 \cdot 10^{-273}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - t\_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if F < -7.6000000000000003e96 or -2.05e60 < F < -3.6999999999999999e-35

    1. Initial program 58.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 90.9%

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

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

    if -7.6000000000000003e96 < F < -2.05e60

    1. Initial program 99.1%

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}} \]
      3. 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}} \]
    6. Taylor expanded in B around 0 99.9%

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

    if -3.6999999999999999e-35 < F < -2.69999999999999984e-273

    1. Initial program 99.4%

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

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

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

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

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

    if -2.69999999999999984e-273 < F < 1.05e-177

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac29.7%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified9.7%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 51.0%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified51.0%

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

    if 1.05e-177 < F < 2.4000000000000001e39

    1. Initial program 99.3%

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

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

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

    if 2.4000000000000001e39 < F

    1. Initial program 52.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 73.5%

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

      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
    5. Step-by-step derivation
      1. un-div-inv50.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.6 \cdot 10^{+96}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.05 \cdot 10^{+60}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.7 \cdot 10^{-273}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-177}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 60.3% accurate, 2.4× speedup?

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

\mathbf{elif}\;F \leq -1.55 \cdot 10^{+60}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq -5 \cdot 10^{-235}:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -2.70000000000000022e96 or -1.55e60 < F < -3.6999999999999999e-35

    1. Initial program 58.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 90.9%

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

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

    if -2.70000000000000022e96 < F < -1.55e60 or -3.6999999999999999e-35 < F < -4.9999999999999998e-235

    1. Initial program 99.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Taylor expanded in B around 0 62.9%

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

    if -4.9999999999999998e-235 < F < 2.3999999999999999e-177

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg9.0%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac29.0%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified9.0%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 48.5%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified48.5%

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

    if 2.3999999999999999e-177 < F

    1. Initial program 69.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+96}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.55 \cdot 10^{+60}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-35}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -5 \cdot 10^{-235}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.4 \cdot 10^{-177}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 52.3% accurate, 2.7× speedup?

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

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

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

\mathbf{elif}\;F \leq 3.2 \cdot 10^{+181}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.3999999999999999e-234 or 2.70000000000000027e-119 < F < 3.2e181

    1. Initial program 78.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 69.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Taylor expanded in B around 0 59.8%

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

    if -2.3999999999999999e-234 < F < 2.70000000000000027e-119

    1. Initial program 99.4%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac29.8%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified9.8%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 48.1%

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

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

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

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

    if 3.2e181 < F

    1. Initial program 21.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 61.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.4 \cdot 10^{-234}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 2.7 \cdot 10^{-119}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{+181}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 56.3% accurate, 2.7× speedup?

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

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

\mathbf{elif}\;x \leq -5 \cdot 10^{-122}:\\
\;\;\;\;\frac{x}{-B}\\

\mathbf{elif}\;x \leq 1.7 \cdot 10^{-21}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.7999999999999998e-4 or 1.7e-21 < x

    1. Initial program 85.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 94.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B} - \frac{x}{\tan B}} \]
    6. Taylor expanded in B around 0 96.6%

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

    if -2.7999999999999998e-4 < x < -4.9999999999999999e-122

    1. Initial program 80.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 21.5%

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac215.8%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified15.8%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 41.2%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified41.2%

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

    if -4.9999999999999999e-122 < x < 1.7e-21

    1. Initial program 65.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 37.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.00028:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-21}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 43.1% accurate, 2.9× speedup?

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

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

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

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


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

    1. Initial program 62.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 92.8%

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac247.6%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified47.6%

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

    if -1.4599999999999999e-34 < F < 1.02e18

    1. Initial program 99.3%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac216.6%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified16.6%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 37.4%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified37.4%

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

    if 1.02e18 < F

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.46 \cdot 10^{-34}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.02 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 36.2% accurate, 21.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.26 \cdot 10^{+138}:\\
\;\;\;\;\frac{-1}{B}\\

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

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


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

    1. Initial program 35.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg44.1%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac244.1%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified44.1%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 29.1%

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

    if -1.25999999999999994e138 < F < 1.1e-41

    1. Initial program 98.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg26.4%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac226.4%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified26.4%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 36.1%

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

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

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

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

    if 1.1e-41 < F

    1. Initial program 60.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.26 \cdot 10^{+138}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 1.1 \cdot 10^{-41}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 43.2% accurate, 21.6× speedup?

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

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

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

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


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

    1. Initial program 62.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 92.8%

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac247.6%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified47.6%

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

    if -6.0000000000000001e-32 < F < 6.59999999999999964e-37

    1. Initial program 99.3%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg15.2%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac215.2%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified15.2%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 38.2%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified38.2%

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

    if 6.59999999999999964e-37 < F

    1. Initial program 60.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-37}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 29.3% accurate, 23.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.8 \cdot 10^{+137}:\\
\;\;\;\;\frac{-1}{B}\\

\mathbf{elif}\;F \leq 2.05 \cdot 10^{+257}:\\
\;\;\;\;\frac{x}{-B}\\

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


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

    1. Initial program 35.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg44.1%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac244.1%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified44.1%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 29.1%

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

    if -7.80000000000000059e137 < F < 2.0500000000000001e257

    1. Initial program 90.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 49.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg27.3%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac227.3%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified27.3%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around inf 34.4%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    9. Simplified34.4%

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

    if 2.0500000000000001e257 < F

    1. Initial program 22.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 22.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    5. Step-by-step derivation
      1. mul-1-neg2.4%

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac22.4%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified2.4%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt1.2%

        \[\leadsto \frac{1 + x}{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}} \]
      2. *-un-lft-identity1.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\sqrt{B}} \cdot \frac{1 + x}{\sqrt{B}}} \]
      7. +-commutative21.7%

        \[\leadsto \frac{1}{\sqrt{B}} \cdot \frac{\color{blue}{x + 1}}{\sqrt{B}} \]
    8. Applied egg-rr21.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x + 1}{\sqrt{B}}}{\sqrt{B}}} \]
      2. *-lft-identity21.7%

        \[\leadsto \frac{\color{blue}{\frac{x + 1}{\sqrt{B}}}}{\sqrt{B}} \]
    10. Simplified21.7%

      \[\leadsto \color{blue}{\frac{\frac{x + 1}{\sqrt{B}}}{\sqrt{B}}} \]
    11. Taylor expanded in x around 0 44.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{+137}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{+257}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 16.6% accurate, 40.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-287}:\\
\;\;\;\;\frac{-1}{B}\\

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


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

    1. Initial program 74.4%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac239.7%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified39.7%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Taylor expanded in x around 0 19.8%

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

    if -1.25000000000000006e-287 < F

    1. Initial program 76.6%

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

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

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

        \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
      2. distribute-neg-frac217.7%

        \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    6. Simplified17.7%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt8.5%

        \[\leadsto \frac{1 + x}{\color{blue}{\sqrt{-B} \cdot \sqrt{-B}}} \]
      2. *-un-lft-identity8.5%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\sqrt{B}} \cdot \frac{1 + x}{\sqrt{B}}} \]
      7. +-commutative10.4%

        \[\leadsto \frac{1}{\sqrt{B}} \cdot \frac{\color{blue}{x + 1}}{\sqrt{B}} \]
    8. Applied egg-rr10.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x + 1}{\sqrt{B}}}{\sqrt{B}}} \]
      2. *-lft-identity10.5%

        \[\leadsto \frac{\color{blue}{\frac{x + 1}{\sqrt{B}}}}{\sqrt{B}} \]
    10. Simplified10.5%

      \[\leadsto \color{blue}{\frac{\frac{x + 1}{\sqrt{B}}}{\sqrt{B}}} \]
    11. Taylor expanded in x around 0 15.7%

      \[\leadsto \color{blue}{\frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification17.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{-287}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 10.1% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 75.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 58.2%

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

    \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
  5. Step-by-step derivation
    1. mul-1-neg29.4%

      \[\leadsto \color{blue}{-\frac{1 + x}{B}} \]
    2. distribute-neg-frac229.4%

      \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  6. Simplified29.4%

    \[\leadsto \color{blue}{\frac{1 + x}{-B}} \]
  7. Taylor expanded in x around 0 11.9%

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  8. Final simplification11.9%

    \[\leadsto \frac{-1}{B} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024077 
(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))))))