VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.5% → 99.6%
Time: 18.7s
Alternatives: 28
Speedup: 1.4×

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 28 alternatives:

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

Initial Program: 76.5% 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 -15000000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 64000000:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -15000000000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 64000000.0)
       (- (/ (/ F (sin B)) (sqrt (fma F F 2.0))) t_0)
       (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -15000000000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 64000000.0) {
		tmp = ((F / sin(B)) / sqrt(fma(F, F, 2.0))) - t_0;
	} else {
		tmp = (1.0 / sin(B)) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -15000000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 64000000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(F, F, 2.0))) - t_0);
	else
		tmp = Float64(Float64(1.0 / sin(B)) - t_0);
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -15000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 64000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 64000000:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\

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


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

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

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

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

    if -1.5e13 < F < 6.4e7

    1. Initial program 99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

    if 6.4e7 < F

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

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

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

Alternative 2: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

    if -1.22e8 < F < 7e7

    1. Initial program 99.4%

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

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

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

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

    if 7e7 < F

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

    if -1.32e8 < F < 2.6e7

    1. Initial program 99.4%

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

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

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

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

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

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

    if 2.6e7 < F

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

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

    if -1.45e8 < F < 7.5e7

    1. Initial program 99.4%

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

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

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

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

    if 7.5e7 < F

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

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

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\

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


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

    1. Initial program 68.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. Simplified81.0%

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

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

    if -1.4199999999999999 < F < 1.44999999999999996

    1. Initial program 99.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}} - \frac{x}{\tan B} \]
    9. Step-by-step derivation
      1. *-commutative99.6%

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

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

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

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

    if 1.44999999999999996 < F

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

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

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

Alternative 6: 99.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 68.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. Simplified81.0%

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

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

    if -1.4199999999999999 < F < 1.44999999999999996

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

    if 1.44999999999999996 < F

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

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

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

Alternative 7: 90.1% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -4.1 \cdot 10^{-162}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 1.1 \cdot 10^{-130}:\\
\;\;\;\;\frac{t\_0}{F + \frac{1}{F}} - t\_2\\

\mathbf{elif}\;F \leq 49000:\\
\;\;\;\;t\_1\\

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


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

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

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

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

    if -8.2e5 < F < -4.10000000000000019e-162 or 1.0999999999999999e-130 < F < 49000

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/89.9%

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

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

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

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

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

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

    if -4.10000000000000019e-162 < F < 1.0999999999999999e-130

    1. Initial program 99.4%

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-2}} \cdot \left(-F\right)} - \frac{x}{\tan B} \]
      10. add-sqr-sqrt42.6%

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

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \color{blue}{\left(\sqrt{F} \cdot \sqrt{F}\right)}} - \frac{x}{\tan B} \]
      14. add-sqr-sqrt92.7%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \color{blue}{F}} - \frac{x}{\tan B} \]
    15. Applied egg-rr92.7%

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + {F}^{-2} \cdot F}} - \frac{x}{\tan B} \]
    16. Step-by-step derivation
      1. pow-plus92.7%

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-1}}} - \frac{x}{\tan B} \]
      3. unpow-192.7%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + \color{blue}{\frac{1}{F}}} - \frac{x}{\tan B} \]
    17. Simplified92.7%

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

    if 49000 < F

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

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

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

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

Alternative 8: 89.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
t_1 := \frac{1}{\sin B}\\
t_2 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_3 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.00135:\\
\;\;\;\;\frac{-1}{\sin B} - t\_3\\

\mathbf{elif}\;F \leq -5.5 \cdot 10^{-157}:\\
\;\;\;\;F \cdot \left(t\_1 \cdot t\_2\right) - \frac{x}{B}\\

\mathbf{elif}\;F \leq 8 \cdot 10^{-133}:\\
\;\;\;\;\frac{t\_0}{F + \frac{1}{F}} - t\_3\\

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

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


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

    1. Initial program 68.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. Simplified81.0%

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

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

    if -0.0013500000000000001 < F < -5.4999999999999998e-157

    1. Initial program 99.3%

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

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

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

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

    if -5.4999999999999998e-157 < F < 8.0000000000000005e-133

    1. Initial program 99.4%

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-2}} \cdot \left(-F\right)} - \frac{x}{\tan B} \]
      10. add-sqr-sqrt42.6%

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

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \color{blue}{\left(\sqrt{F} \cdot \sqrt{F}\right)}} - \frac{x}{\tan B} \]
      14. add-sqr-sqrt92.7%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \color{blue}{F}} - \frac{x}{\tan B} \]
    15. Applied egg-rr92.7%

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + {F}^{-2} \cdot F}} - \frac{x}{\tan B} \]
    16. Step-by-step derivation
      1. pow-plus92.7%

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-1}}} - \frac{x}{\tan B} \]
      3. unpow-192.7%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + \color{blue}{\frac{1}{F}}} - \frac{x}{\tan B} \]
    17. Simplified92.7%

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

    if 8.0000000000000005e-133 < F < 0.048000000000000001

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/94.8%

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

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

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

      \[\leadsto \frac{-x}{B} + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    7. Step-by-step derivation
      1. *-commutative93.4%

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

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

    if 0.048000000000000001 < F

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

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

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

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

Alternative 9: 89.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
t_1 := t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.00135:\\
\;\;\;\;\frac{-1}{\sin B} - t\_2\\

\mathbf{elif}\;F \leq -2.55 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;F \leq 3.8 \cdot 10^{-132}:\\
\;\;\;\;\frac{t\_0}{F + \frac{1}{F}} - t\_2\\

\mathbf{elif}\;F \leq 0.185:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 68.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. Simplified81.0%

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

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

    if -0.0013500000000000001 < F < -2.5500000000000001e-166 or 3.7999999999999997e-132 < F < 0.185

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/89.2%

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

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

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

      \[\leadsto \frac{-x}{B} + \frac{F}{\sin B} \cdot \color{blue}{\sqrt{\frac{1}{2 + 2 \cdot x}}} \]
    7. Step-by-step derivation
      1. *-commutative88.7%

        \[\leadsto \frac{-x}{B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + \color{blue}{x \cdot 2}}} \]
    8. Simplified88.7%

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

    if -2.5500000000000001e-166 < F < 3.7999999999999997e-132

    1. Initial program 99.4%

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-2}} \cdot \left(-F\right)} - \frac{x}{\tan B} \]
      10. add-sqr-sqrt42.6%

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

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \color{blue}{\left(\sqrt{F} \cdot \sqrt{F}\right)}} - \frac{x}{\tan B} \]
      14. add-sqr-sqrt92.7%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \color{blue}{F}} - \frac{x}{\tan B} \]
    15. Applied egg-rr92.7%

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + {F}^{-2} \cdot F}} - \frac{x}{\tan B} \]
    16. Step-by-step derivation
      1. pow-plus92.7%

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-1}}} - \frac{x}{\tan B} \]
      3. unpow-192.7%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + \color{blue}{\frac{1}{F}}} - \frac{x}{\tan B} \]
    17. Simplified92.7%

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

    if 0.185 < F

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00135:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -2.55 \cdot 10^{-166}:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{F + \frac{1}{F}} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 0.185:\\ \;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 91.9% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 4.6 \cdot 10^{-129}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_1 \cdot \frac{F}{B}\\

\mathbf{elif}\;F \leq 9500000:\\
\;\;\;\;\left(F \cdot t\_0\right) \cdot t\_1 - \frac{x}{B}\\

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


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

    1. Initial program 68.1%

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

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

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

    if -900 < F < 4.5999999999999999e-129

    1. Initial program 99.4%

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

      \[\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 4.5999999999999999e-129 < F < 9.5e6

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/95.2%

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

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

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

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

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

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

    if 9.5e6 < F

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

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

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

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

Alternative 11: 91.9% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 2.1 \cdot 10^{-130}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0 \cdot \frac{F}{B}\\

\mathbf{elif}\;F \leq 750000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\

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


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

    1. Initial program 68.1%

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

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

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

    if -820 < F < 2.10000000000000002e-130

    1. Initial program 99.4%

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

      \[\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 2.10000000000000002e-130 < F < 7.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. Add Preprocessing
    3. Taylor expanded in B around 0 95.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/95.2%

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

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

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

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

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

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

    if 7.5e5 < F

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

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

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

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

Alternative 12: 71.3% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -460:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\

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

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

\mathbf{elif}\;F \leq 1050:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

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

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

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

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

    if -4.0000000000000001e94 < F < -460

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 85.3%

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

    if -460 < F < -1.18e-155

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/86.2%

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

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

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

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

    if -1.18e-155 < F < 4.50000000000000009e-69

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.50000000000000009e-69 < F < 1050

    1. Initial program 99.0%

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

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

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

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

    if 1050 < F

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -4 \cdot 10^{+94}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -460:\\ \;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.18 \cdot 10^{-155}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 4.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1050:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 71.3% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq -1050:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\

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

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

\mathbf{elif}\;F \leq 1050:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

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

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

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

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

    if -3.7999999999999996e94 < F < -1050

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 85.3%

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

    if -1050 < F < -1.0500000000000001e-155

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/86.2%

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

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

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

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

    if -1.0500000000000001e-155 < F < 9.6000000000000005e-70

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.6000000000000005e-70 < F < 1050

    1. Initial program 99.0%

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

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

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

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

    if 1050 < F

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.8 \cdot 10^{+94}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1050:\\ \;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.05 \cdot 10^{-155}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 9.6 \cdot 10^{-70}:\\ \;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 1050:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 86.0% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;F \leq 1.25 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{F + \frac{1}{F}} - t\_0\\

\mathbf{elif}\;F \leq 5.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

    1. Initial program 68.1%

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

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

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

    if -320 < F < -1.6500000000000001e-158

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.3%

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

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

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

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

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

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

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

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

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

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

    if -1.6500000000000001e-158 < F < 1.25000000000000008e-69

    1. Initial program 99.4%

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. +-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{\left(-F\right) \cdot \left(1 + \frac{1}{{F}^{2}}\right)}} - \frac{x}{\tan B} \]
    14. Step-by-step derivation
      1. distribute-rgt-in86.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + \color{blue}{{F}^{\left(-2\right)}} \cdot \left(-F\right)} - \frac{x}{\tan B} \]
      9. metadata-eval86.0%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-2}} \cdot \left(-F\right)} - \frac{x}{\tan B} \]
      10. add-sqr-sqrt35.2%

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

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \sqrt{\color{blue}{F \cdot F}}} - \frac{x}{\tan B} \]
      13. sqrt-prod50.9%

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{-2} \cdot \color{blue}{F}} - \frac{x}{\tan B} \]
    15. Applied egg-rr86.1%

      \[\leadsto \frac{\frac{F}{\sin B}}{\color{blue}{F + {F}^{-2} \cdot F}} - \frac{x}{\tan B} \]
    16. Step-by-step derivation
      1. pow-plus86.1%

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

        \[\leadsto \frac{\frac{F}{\sin B}}{F + {F}^{\color{blue}{-1}}} - \frac{x}{\tan B} \]
      3. unpow-186.1%

        \[\leadsto \frac{\frac{F}{\sin B}}{F + \color{blue}{\frac{1}{F}}} - \frac{x}{\tan B} \]
    17. Simplified86.1%

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

    if 1.25000000000000008e-69 < F < 5.19999999999999968e-5

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

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

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

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

    if 5.19999999999999968e-5 < F

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

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

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

Alternative 15: 85.9% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 0.00024:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

    1. Initial program 68.1%

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

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

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

    if -250 < F < -3.8000000000000001e-161

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    7. Step-by-step derivation
      1. *-commutative99.3%

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

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

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

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

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

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

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

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

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

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

    if -3.8000000000000001e-161 < F < 2.1e-69

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e-69 < F < 2.40000000000000006e-4

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

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

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

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

    if 2.40000000000000006e-4 < F

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -250:\\ \;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -3.8 \cdot 10^{-161}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}} - x}{B}\\ \mathbf{elif}\;F \leq 2.1 \cdot 10^{-69}:\\ \;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\ \mathbf{elif}\;F \leq 0.00024:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 85.9% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 5.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

    1. Initial program 68.1%

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

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

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

    if -370 < F < -8.8e-160

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/86.2%

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

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

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

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

    if -8.8e-160 < F < 1.25000000000000008e-69

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25000000000000008e-69 < F < 5.3999999999999998e-5

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

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

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

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

    if 5.3999999999999998e-5 < F

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

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

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

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

Alternative 17: 78.1% accurate, 1.4× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 1050:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\

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


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

    1. Initial program 68.1%

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

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

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

    if -260 < F < -8.5e-156

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/86.2%

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

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

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

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

    if -8.5e-156 < F < 4.4e-69

    1. Initial program 99.4%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4e-69 < F < 1050

    1. Initial program 99.0%

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

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

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

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

    if 1050 < F

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.8%

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

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

Alternative 18: 63.0% accurate, 2.3× speedup?

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

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

\mathbf{elif}\;F \leq -1150:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\

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

\mathbf{elif}\;F \leq -2.8 \cdot 10^{-265}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -3.9000000000000002e90 or -1.5499999999999999e-156 < F < -2.80000000000000023e-265

    1. Initial program 68.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. Simplified80.2%

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

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

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

    if -3.9000000000000002e90 < F < -1150

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 85.3%

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

    if -1150 < F < -1.5499999999999999e-156 or -2.80000000000000023e-265 < F < 105000

    1. Initial program 99.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} + \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. associate-*r/81.8%

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

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

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

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

    if 105000 < F

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.6%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.6%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 79.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.9 \cdot 10^{+90}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -1150:\\ \;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.55 \cdot 10^{-156}:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -2.8 \cdot 10^{-265}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 105000:\\ \;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 62.9% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{-1}{B} - t\_1\\
\mathbf{if}\;F \leq -1.25 \cdot 10^{+93}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;F \leq -0.37:\\
\;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\

\mathbf{elif}\;F \leq -1.4 \cdot 10^{-157}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;F \leq -1.85 \cdot 10^{-264}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -1.25e93 or -1.40000000000000005e-157 < F < -1.84999999999999998e-264

    1. Initial program 68.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. Simplified80.2%

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

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

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

    if -1.25e93 < F < -0.37

    1. Initial program 96.3%

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

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 83.7%

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

    if -0.37 < F < -1.40000000000000005e-157 or -1.84999999999999998e-264 < F < 1050

    1. Initial program 99.3%

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

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

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

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

    if 1050 < F

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*99.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified99.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 78.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.25 \cdot 10^{+93}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -0.37:\\ \;\;\;\;\frac{F \cdot \frac{-1}{F}}{\sin B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq -1.4 \cdot 10^{-157}:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{elif}\;F \leq -1.85 \cdot 10^{-264}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1050:\\ \;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 55.1% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-143} \lor \neg \left(x \leq 1.28 \cdot 10^{-272}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\

\mathbf{else}:\\
\;\;\;\;\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.39999999999999983e-143 or 1.27999999999999996e-272 < x

    1. Initial program 81.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. Simplified90.0%

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

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

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

    if -3.39999999999999983e-143 < x < 1.27999999999999996e-272

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

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

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    6. Step-by-step derivation
      1. associate-/l*45.5%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    7. Simplified45.5%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    8. Taylor expanded in B around 0 35.1%

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{B}} \]
    9. Step-by-step derivation
      1. div-inv35.1%

        \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{B}} \]
    10. Applied egg-rr35.1%

      \[\leadsto \color{blue}{\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-143} \lor \neg \left(x \leq 1.28 \cdot 10^{-272}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(F \cdot \sqrt{0.5}\right) \cdot \frac{1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 60.8% accurate, 2.8× speedup?

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

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

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

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


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

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

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

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

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

    if -6.79999999999999997e-282 < F < 1.02000000000000005e-265

    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. Simplified100.0%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*1.5%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified1.5%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 12.2%

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified100.0%

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

    if 1.02000000000000005e-265 < F

    1. Initial program 77.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. Simplified85.7%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*66.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified66.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 64.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -6.8 \cdot 10^{-282}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq 1.02 \cdot 10^{-265}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 48.6% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;B \leq 7 \cdot 10^{-23}:\\
\;\;\;\;\frac{\frac{-1}{1 + \frac{1}{{F}^{2}}} - x}{B}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 6.99999999999999987e-23

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

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

      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. +-commutative76.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    10. Simplified77.0%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x + \frac{1}{1 + \frac{1}{{F}^{2}}}}{B}} \]
    15. Step-by-step derivation
      1. mul-1-neg52.4%

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

        \[\leadsto \color{blue}{\frac{x + \frac{1}{1 + \frac{1}{{F}^{2}}}}{-B}} \]
    16. Simplified52.4%

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

    if 6.99999999999999987e-23 < B

    1. Initial program 93.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. Simplified93.8%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*54.3%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 63.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 7 \cdot 10^{-23}:\\ \;\;\;\;\frac{\frac{-1}{1 + \frac{1}{{F}^{2}}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 43.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.45 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-65}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -2.45e-5)
   (/ (- -1.0 x) B)
   (if (<= F -6.2e-65)
     (* F (/ (sqrt 0.5) B))
     (if (<= F 6.5e-69) (/ x (- B)) (- (/ 1.0 B) (/ x B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -2.45e-5) {
		tmp = (-1.0 - x) / B;
	} else if (F <= -6.2e-65) {
		tmp = F * (sqrt(0.5) / B);
	} else if (F <= 6.5e-69) {
		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.45d-5)) then
        tmp = ((-1.0d0) - x) / b
    else if (f <= (-6.2d-65)) then
        tmp = f * (sqrt(0.5d0) / b)
    else if (f <= 6.5d-69) 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.45e-5) {
		tmp = (-1.0 - x) / B;
	} else if (F <= -6.2e-65) {
		tmp = F * (Math.sqrt(0.5) / B);
	} else if (F <= 6.5e-69) {
		tmp = x / -B;
	} else {
		tmp = (1.0 / B) - (x / B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -2.45e-5:
		tmp = (-1.0 - x) / B
	elif F <= -6.2e-65:
		tmp = F * (math.sqrt(0.5) / B)
	elif F <= 6.5e-69:
		tmp = x / -B
	else:
		tmp = (1.0 / B) - (x / B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -2.45e-5)
		tmp = Float64(Float64(-1.0 - x) / B);
	elseif (F <= -6.2e-65)
		tmp = Float64(F * Float64(sqrt(0.5) / B));
	elseif (F <= 6.5e-69)
		tmp = Float64(x / Float64(-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.45e-5)
		tmp = (-1.0 - x) / B;
	elseif (F <= -6.2e-65)
		tmp = F * (sqrt(0.5) / B);
	elseif (F <= 6.5e-69)
		tmp = x / -B;
	else
		tmp = (1.0 / B) - (x / B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -2.45e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -6.2e-65], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-69], 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.45 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{elif}\;F \leq -6.2 \cdot 10^{-65}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B}\\

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

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


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

    1. Initial program 68.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. Simplified81.0%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 49.0%

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

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

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

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

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

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

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

    if -2.45e-5 < F < -6.20000000000000032e-65

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

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

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

      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{0.5}}{\sin B}} \]
    6. Step-by-step derivation
      1. associate-/l*63.9%

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    7. Simplified63.9%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{\sin B}} \]
    8. Taylor expanded in B around 0 63.8%

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

        \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{B}} \]
    10. Simplified64.0%

      \[\leadsto \color{blue}{F \cdot \frac{\sqrt{0.5}}{B}} \]

    if -6.20000000000000032e-65 < F < 6.49999999999999951e-69

    1. Initial program 99.4%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*18.4%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 25.5%

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified50.0%

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

    if 6.49999999999999951e-69 < F

    1. Initial program 66.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. Simplified78.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*88.4%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 41.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Step-by-step derivation
      1. div-sub41.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -2.45 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -6.2 \cdot 10^{-65}:\\ \;\;\;\;F \cdot \frac{\sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 42.7% accurate, 19.0× speedup?

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

\mathbf{elif}\;F \leq 8.2 \cdot 10^{-69}:\\
\;\;\;\;\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 < -1.65e-64

    1. Initial program 72.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. Simplified83.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/83.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 45.1%

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

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

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

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

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

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

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

    if -1.65e-64 < F < 8.1999999999999998e-69

    1. Initial program 99.4%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*18.4%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 25.5%

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified50.0%

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

    if 8.1999999999999998e-69 < F

    1. Initial program 66.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. Simplified78.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*88.4%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 41.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Step-by-step derivation
      1. div-sub41.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.65 \cdot 10^{-64}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 42.7% accurate, 21.6× speedup?

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

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

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

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


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

    1. Initial program 72.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. Simplified83.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/83.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 45.1%

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

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

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

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

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

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

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

    if -1.1500000000000001e-64 < F < 5.00000000000000033e-69

    1. Initial program 99.4%

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

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*18.4%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 25.5%

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified50.0%

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

    if 5.00000000000000033e-69 < F

    1. Initial program 66.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. Simplified78.6%

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

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*88.4%

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

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 41.5%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification46.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.15 \cdot 10^{-64}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-69}:\\ \;\;\;\;\frac{x}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 36.1% accurate, 32.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.95 \cdot 10^{-64}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.95e-64) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.95e-64) {
		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.95d-64)) 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.95e-64) {
		tmp = (-1.0 - x) / B;
	} else {
		tmp = x / -B;
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.95e-64:
		tmp = (-1.0 - x) / B
	else:
		tmp = x / -B
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.95e-64)
		tmp = Float64(Float64(-1.0 - x) / B);
	else
		tmp = Float64(x / Float64(-B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.95e-64)
		tmp = (-1.0 - x) / B;
	else
		tmp = x / -B;
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.95e-64], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{-64}:\\
\;\;\;\;\frac{-1 - x}{B}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -1.9499999999999998e-64

    1. Initial program 72.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. Simplified83.2%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r/83.3%

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} - \frac{x}{\tan B} \]
      2. fma-undefine83.3%

        \[\leadsto \frac{F \cdot {\color{blue}{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}}^{-0.5}}{\sin B} - \frac{x}{\tan B} \]
      3. +-commutative83.3%

        \[\leadsto \frac{F \cdot {\color{blue}{\left(\mathsf{fma}\left(F, F, 2\right) + x \cdot 2\right)}}^{-0.5}}{\sin B} - \frac{x}{\tan B} \]
      4. metadata-eval83.3%

        \[\leadsto \frac{F \cdot {\left(\mathsf{fma}\left(F, F, 2\right) + x \cdot 2\right)}^{\color{blue}{\left(-0.5\right)}}}{\sin B} - \frac{x}{\tan B} \]
      5. metadata-eval83.3%

        \[\leadsto \frac{F \cdot {\left(\mathsf{fma}\left(F, F, 2\right) + x \cdot 2\right)}^{\left(-\color{blue}{\frac{1}{2}}\right)}}{\sin B} - \frac{x}{\tan B} \]
      6. fma-define83.3%

        \[\leadsto \frac{F \cdot {\left(\color{blue}{\left(F \cdot F + 2\right)} + x \cdot 2\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{x}{\tan B} \]
      7. *-commutative83.3%

        \[\leadsto \frac{F \cdot {\left(\left(F \cdot F + 2\right) + \color{blue}{2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{x}{\tan B} \]
      8. fma-define83.3%

        \[\leadsto \frac{F \cdot {\left(\color{blue}{\mathsf{fma}\left(F, F, 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{x}{\tan B} \]
      9. +-commutative83.3%

        \[\leadsto \frac{F \cdot {\color{blue}{\left(2 \cdot x + \mathsf{fma}\left(F, F, 2\right)\right)}}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{x}{\tan B} \]
      10. fma-define83.3%

        \[\leadsto \frac{F \cdot {\color{blue}{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}}^{\left(-\frac{1}{2}\right)}}{\sin B} - \frac{x}{\tan B} \]
      11. metadata-eval83.3%

        \[\leadsto \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\left(-\color{blue}{0.5}\right)}}{\sin B} - \frac{x}{\tan B} \]
      12. metadata-eval83.3%

        \[\leadsto \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\color{blue}{-0.5}}}{\sin B} - \frac{x}{\tan B} \]
    5. Applied egg-rr83.3%

      \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} - \frac{x}{\tan B} \]
    6. Taylor expanded in F around -inf 90.7%

      \[\leadsto \frac{F \cdot \color{blue}{\frac{-1}{F}}}{\sin B} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 45.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{1 + x}{B}} \]
    8. Step-by-step derivation
      1. associate-*r/45.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(1 + x\right)}{B}} \]
      2. neg-mul-145.1%

        \[\leadsto \frac{\color{blue}{-\left(1 + x\right)}}{B} \]
      3. distribute-neg-in45.1%

        \[\leadsto \frac{\color{blue}{\left(-1\right) + \left(-x\right)}}{B} \]
      4. metadata-eval45.1%

        \[\leadsto \frac{\color{blue}{-1} + \left(-x\right)}{B} \]
      5. unsub-neg45.1%

        \[\leadsto \frac{\color{blue}{-1 - x}}{B} \]
    9. Simplified45.1%

      \[\leadsto \color{blue}{\frac{-1 - x}{B}} \]

    if -1.9499999999999998e-64 < F

    1. Initial program 85.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. Simplified90.8%

      \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
    3. Add Preprocessing
    4. Taylor expanded in F around inf 48.0%

      \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
    5. Step-by-step derivation
      1. associate-/r*48.0%

        \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    6. Simplified48.0%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
    7. Taylor expanded in B around 0 32.3%

      \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
    8. Taylor expanded in x around inf 37.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
    9. Step-by-step derivation
      1. associate-*r/37.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
      2. neg-mul-137.8%

        \[\leadsto \frac{\color{blue}{-x}}{B} \]
    10. Simplified37.8%

      \[\leadsto \color{blue}{\frac{-x}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.95 \cdot 10^{-64}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 29.1% 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(x / Float64(-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 81.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. Simplified88.3%

    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
  3. Add Preprocessing
  4. Taylor expanded in F around inf 46.5%

    \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
  5. Step-by-step derivation
    1. associate-/r*46.5%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
  6. Simplified46.5%

    \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
  7. Taylor expanded in B around 0 27.8%

    \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  8. Taylor expanded in x around inf 31.9%

    \[\leadsto \color{blue}{-1 \cdot \frac{x}{B}} \]
  9. Step-by-step derivation
    1. associate-*r/31.9%

      \[\leadsto \color{blue}{\frac{-1 \cdot x}{B}} \]
    2. neg-mul-131.9%

      \[\leadsto \frac{\color{blue}{-x}}{B} \]
  10. Simplified31.9%

    \[\leadsto \color{blue}{\frac{-x}{B}} \]
  11. Final simplification31.9%

    \[\leadsto \frac{x}{-B} \]
  12. Add Preprocessing

Alternative 28: 9.4% 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 81.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. Simplified88.3%

    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}} \]
  3. Add Preprocessing
  4. Taylor expanded in F around inf 46.5%

    \[\leadsto F \cdot \color{blue}{\frac{1}{F \cdot \sin B}} - \frac{x}{\tan B} \]
  5. Step-by-step derivation
    1. associate-/r*46.5%

      \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
  6. Simplified46.5%

    \[\leadsto F \cdot \color{blue}{\frac{\frac{1}{F}}{\sin B}} - \frac{x}{\tan B} \]
  7. Taylor expanded in B around 0 27.8%

    \[\leadsto \color{blue}{\frac{1 - x}{B}} \]
  8. Taylor expanded in x around 0 7.7%

    \[\leadsto \color{blue}{\frac{1}{B}} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024136 
(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))))))