VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.3% → 99.6%
Time: 23.5s
Alternatives: 22
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 22 alternatives:

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

Initial Program: 77.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 54.9%

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

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

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

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

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

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

    if -5.0000000000000001e29 < F < 8e5

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 8e5 < F

    1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.9%

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

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

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

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

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

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

    if -3.5999999999999999e28 < F < 1.94999999999999992e51

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

    if 1.94999999999999992e51 < F

    1. Initial program 46.7%

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

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

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

Alternative 3: 98.6% accurate, 1.0× speedup?

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

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{F}{\sin B \cdot \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 < -0.066000000000000003

    1. Initial program 57.6%

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

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

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

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

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

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

    if -0.066000000000000003 < F < 4.1999999999999997e-11

    1. Initial program 99.5%

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

        \[\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. associate-/l*99.5%

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

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

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

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

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

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

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

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

    if 4.1999999999999997e-11 < F

    1. Initial program 56.5%

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

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

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

Alternative 4: 91.9% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

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

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

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

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

    if -0.066000000000000003 < F < 9e5

    1. Initial program 99.5%

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

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

    if 9e5 < F

    1. Initial program 54.5%

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

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

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

Alternative 5: 91.9% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

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

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

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

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

    if -0.066000000000000003 < F < 8.5e5

    1. Initial program 99.5%

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

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

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

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

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

    if 8.5e5 < F

    1. Initial program 54.5%

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

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

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

Alternative 6: 91.6% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

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

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

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

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

    if -0.066000000000000003 < F < 4.1999999999999997e-11

    1. Initial program 99.5%

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

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

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

    if 4.1999999999999997e-11 < F

    1. Initial program 56.5%

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

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

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

Alternative 7: 91.6% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 57.6%

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

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

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

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

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

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

    if -0.0550000000000000003 < F < 4.1999999999999997e-11

    1. Initial program 99.5%

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

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

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

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

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

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

    if 4.1999999999999997e-11 < F

    1. Initial program 56.5%

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

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

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

Alternative 8: 84.2% accurate, 1.5× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 6.6 \cdot 10^{-14}:\\
\;\;\;\;t_0 - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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


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

    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. Taylor expanded in F around -inf 94.9%

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

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

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

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

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

    if -7.79999999999999996e-22 < F < -4.9999999999999999e-172

    1. Initial program 99.7%

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

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

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

    if -4.9999999999999999e-172 < F < 8.9999999999999998e-127

    1. Initial program 99.5%

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

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

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

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

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

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

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

    if 8.9999999999999998e-127 < F < 6.5999999999999996e-14

    1. Initial program 99.2%

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

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

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

    if 6.5999999999999996e-14 < F

    1. Initial program 56.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5 \cdot 10^{-172}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9 \cdot 10^{-127}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.6 \cdot 10^{-14}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - x \cdot \frac{1}{\tan B}\\ \end{array} \]

Alternative 9: 70.7% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 850000:\\
\;\;\;\;t_0 - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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


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

    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. Taylor expanded in F around -inf 94.9%

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

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

    if -7.79999999999999996e-22 < F < -7.20000000000000029e-172

    1. Initial program 99.7%

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

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

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

    if -7.20000000000000029e-172 < F < 3.49999999999999989e-127

    1. Initial program 99.5%

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

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

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

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

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

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

    if 3.49999999999999989e-127 < F < 8.5e5

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

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

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

    if 8.5e5 < F

    1. Initial program 54.5%

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

        \[\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. associate-/l*77.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-172}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-127}:\\ \;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\ \mathbf{elif}\;F \leq 850000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 10: 70.7% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 850000:\\
\;\;\;\;t_0 - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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


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

    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. Taylor expanded in F around -inf 94.9%

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

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

    if -7.79999999999999996e-22 < F < -7.20000000000000029e-172

    1. Initial program 99.7%

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

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

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

    if -7.20000000000000029e-172 < F < 1.45e-127

    1. Initial program 99.5%

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

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

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

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

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

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

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

    if 1.45e-127 < F < 8.5e5

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

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

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

    if 8.5e5 < F

    1. Initial program 54.5%

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

        \[\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. associate-/l*77.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -7.2 \cdot 10^{-172}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.45 \cdot 10^{-127}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 850000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 11: 78.0% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;F \leq 850000:\\
\;\;\;\;t_0 - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\

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


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

    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. Taylor expanded in F around -inf 94.9%

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

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

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

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

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

    if -7.79999999999999996e-22 < F < -4.9999999999999999e-172

    1. Initial program 99.7%

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

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

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

    if -4.9999999999999999e-172 < F < 1.1199999999999999e-127

    1. Initial program 99.5%

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

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

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

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

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

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

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

    if 1.1199999999999999e-127 < F < 8.5e5

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

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

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

    if 8.5e5 < F

    1. Initial program 54.5%

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

        \[\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. associate-/l*77.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -5 \cdot 10^{-172}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.12 \cdot 10^{-127}:\\ \;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 850000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 12: 64.9% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \leq -1.3 \cdot 10^{-172}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 3.5 \cdot 10^{-237}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - t_1\\

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

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


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

    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. Taylor expanded in F around -inf 94.9%

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

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

    if -7.79999999999999996e-22 < F < -1.2999999999999999e-172 or 3.49999999999999983e-237 < F < 8.5e5

    1. Initial program 99.4%

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

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

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

    if -1.2999999999999999e-172 < F < 3.49999999999999983e-237

    1. Initial program 99.6%

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

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

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

    if 8.5e5 < F

    1. Initial program 54.5%

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

        \[\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. associate-/l*77.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -1.3 \cdot 10^{-172}:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.5 \cdot 10^{-237}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 850000:\\ \;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 13: 64.7% accurate, 2.6× speedup?

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

\mathbf{elif}\;F \leq -1.12 \cdot 10^{-172}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;F \leq 5 \cdot 10^{-240}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - t_1\\

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-11}:\\
\;\;\;\;t_0\\

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


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

    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. Taylor expanded in F around -inf 94.9%

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

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

    if -7.79999999999999996e-22 < F < -1.11999999999999996e-172 or 5.0000000000000004e-240 < F < 4.1999999999999997e-11

    1. Initial program 99.4%

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

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

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

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

    if -1.11999999999999996e-172 < F < 5.0000000000000004e-240

    1. Initial program 99.6%

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

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

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

    if 4.1999999999999997e-11 < F

    1. Initial program 56.5%

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

        \[\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. associate-/l*78.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -7.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq -1.12 \cdot 10^{-172}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-240}:\\ \;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{-11}:\\ \;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{F \cdot \sin B} - \frac{x}{B}\\ \end{array} \]

Alternative 14: 56.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.35 \cdot 10^{-184} \lor \neg \left(x \leq 7.4 \cdot 10^{-82}\right):\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (or (<= x -2.35e-184) (not (<= x 7.4e-82)))
   (- (/ -1.0 B) (* x (/ 1.0 (tan B))))
   (/ -1.0 (sin B))))
double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.35e-184) || !(x <= 7.4e-82)) {
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	} else {
		tmp = -1.0 / sin(B);
	}
	return tmp;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if ((x <= (-2.35d-184)) .or. (.not. (x <= 7.4d-82))) then
        tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
    else
        tmp = (-1.0d0) / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if ((x <= -2.35e-184) || !(x <= 7.4e-82)) {
		tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
	} else {
		tmp = -1.0 / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if (x <= -2.35e-184) or not (x <= 7.4e-82):
		tmp = (-1.0 / B) - (x * (1.0 / math.tan(B)))
	else:
		tmp = -1.0 / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if ((x <= -2.35e-184) || !(x <= 7.4e-82))
		tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B))));
	else
		tmp = Float64(-1.0 / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if ((x <= -2.35e-184) || ~((x <= 7.4e-82)))
		tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
	else
		tmp = -1.0 / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.35e-184], N[Not[LessEqual[x, 7.4e-82]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{-184} \lor \neg \left(x \leq 7.4 \cdot 10^{-82}\right):\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.3500000000000001e-184 or 7.4000000000000002e-82 < x

    1. Initial program 79.7%

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

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

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

    if -2.3500000000000001e-184 < x < 7.4000000000000002e-82

    1. Initial program 72.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.35 \cdot 10^{-184} \lor \neg \left(x \leq 7.4 \cdot 10^{-82}\right):\\ \;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \end{array} \]

Alternative 15: 60.8% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 81.0%

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

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

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

    if 9.499999999999999e-189 < F

    1. Initial program 71.8%

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

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

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

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

Alternative 16: 61.7% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 0.039:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\

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


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

    1. Initial program 85.0%

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

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

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

    if 0.0389999999999999999 < F

    1. Initial program 55.2%

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

        \[\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. associate-/l*77.6%

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

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

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

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

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

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

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

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

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

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

Alternative 17: 50.6% accurate, 3.0× speedup?

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

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

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

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


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

    1. Initial program 62.7%

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

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

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

    if -3e-32 < F < 1.3e-47

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in21.3%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval21.3%

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 36.8%

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

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

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

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

    if 1.3e-47 < F

    1. Initial program 59.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{-32}:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 1.3 \cdot 10^{-47}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 18: 43.5% accurate, 29.1× speedup?

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

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

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

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


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

    1. Initial program 61.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval43.5%

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

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

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

    if -9.59999999999999968e-29 < F < 1.7499999999999999e-47

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in21.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval21.9%

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 37.1%

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

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

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

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

    if 1.7499999999999999e-47 < F

    1. Initial program 59.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.6 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-47}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 19: 43.6% accurate, 29.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{-28}:\\
\;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\

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

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


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

    1. Initial program 61.7%

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

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

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

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot B + -1 \cdot \frac{1 + x}{B}} \]
      2. mul-1-neg44.3%

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot B - \frac{1 + x}{B}} \]
      4. *-commutative44.3%

        \[\leadsto \color{blue}{B \cdot -0.16666666666666666} - \frac{1 + x}{B} \]
      5. +-commutative44.3%

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

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

    if -2.0500000000000001e-28 < F < 1.7000000000000001e-47

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in21.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval21.9%

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 37.1%

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

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

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

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

    if 1.7000000000000001e-47 < F

    1. Initial program 59.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{-28}:\\ \;\;\;\;B \cdot -0.16666666666666666 - \frac{x + 1}{B}\\ \mathbf{elif}\;F \leq 1.7 \cdot 10^{-47}:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]

Alternative 20: 36.3% accurate, 45.9× speedup?

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

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

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


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

    1. Initial program 61.7%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval43.5%

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

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

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

    if -1.16000000000000005e-27 < F

    1. Initial program 83.1%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. distribute-lft-in24.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
      3. metadata-eval24.7%

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

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

      \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
    6. Taylor expanded in x around inf 33.8%

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    8. Simplified33.8%

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

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

Alternative 21: 29.2% accurate, 81.0× speedup?

\[\begin{array}{l} \\ -\frac{x}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (- (/ x B)))
double code(double F, double B, double x) {
	return -(x / B);
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x / b)
end function
public static double code(double F, double B, double x) {
	return -(x / B);
}
def code(F, B, x):
	return -(x / B)
function code(F, B, x)
	return Float64(-Float64(x / B))
end
function tmp = code(F, B, x)
	tmp = -(x / B);
end
code[F_, B_, x_] := (-N[(x / B), $MachinePrecision])
\begin{array}{l}

\\
-\frac{x}{B}
\end{array}
Derivation
  1. Initial program 77.1%

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

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in30.0%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval30.0%

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

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

    \[\leadsto \color{blue}{\frac{-1 + \left(-x\right)}{B}} \]
  6. Taylor expanded in x around inf 31.2%

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

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

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  8. Simplified31.2%

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

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

Alternative 22: 10.2% accurate, 108.0× speedup?

\[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
	return -1.0 / B;
}
real(8) function code(f, b, x)
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
	return -1.0 / B;
}
def code(F, B, x):
	return -1.0 / B
function code(F, B, x)
	return Float64(-1.0 / B)
end
function tmp = code(F, B, x)
	tmp = -1.0 / B;
end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{B}
\end{array}
Derivation
  1. Initial program 77.1%

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

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

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

      \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
    2. distribute-lft-in30.0%

      \[\leadsto \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{B} \]
    3. metadata-eval30.0%

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

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

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

    \[\leadsto \color{blue}{\frac{-1}{B}} \]
  7. Final simplification8.6%

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

Reproduce

?
herbie shell --seed 2023335 
(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))))))