VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.3% → 99.7%
Time: 16.7s
Alternatives: 22
Speedup: 2.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 77.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% 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 -2 \cdot 10^{+42}:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 110000000:\\ \;\;\;\;\mathsf{fma}\left(t\_0, F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x (tan B)))))
   (if (<= F -2e+42)
     (/ (- -1.0 (* x (cos B))) (sin B))
     (if (<= F 110000000.0)
       (fma t_0 (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) t_1)
       (fma t_0 1.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 <= -2e+42) {
		tmp = (-1.0 - (x * cos(B))) / sin(B);
	} else if (F <= 110000000.0) {
		tmp = fma(t_0, (F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)), t_1);
	} else {
		tmp = fma(t_0, 1.0, t_1);
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(1.0 / sin(B))
	t_1 = Float64(-Float64(x / tan(B)))
	tmp = 0.0
	if (F <= -2e+42)
		tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B));
	elseif (F <= 110000000.0)
		tmp = fma(t_0, Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)), t_1);
	else
		tmp = fma(t_0, 1.0, t_1);
	end
	return 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, -2e+42], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(t$95$0 * N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.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 -2 \cdot 10^{+42}:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\


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

    1. Initial program 60.0%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
      5. clear-numN/A

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

        \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
      8. lower-fma.f64N/A

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

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

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

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

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

      if -2.00000000000000009e42 < F < 1.1e8

      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. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        4. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        5. clear-numN/A

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

          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        7. associate-*l*N/A

          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        8. lower-fma.f64N/A

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

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

      if 1.1e8 < F

      1. Initial program 64.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. lift-+.f64N/A

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

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        4. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        5. clear-numN/A

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

          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        7. associate-*l*N/A

          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        8. lower-fma.f64N/A

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

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

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

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

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

      Alternative 2: 79.0% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ t_1 := \mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+284}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0
               (+
                (* x (/ -1.0 (tan B)))
                (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) (/ -1.0 2.0)))))
              (t_1
               (fma
                (/
                 1.0
                 (*
                  (sqrt (fma F F (fma 2.0 x 2.0)))
                  (fma B (* (* B B) -0.16666666666666666) B)))
                F
                (- (/ x (tan B))))))
         (if (<= t_0 -5e+19)
           t_1
           (if (<= t_0 10.0)
             (/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
             (if (<= t_0 2e+284) t_1 (/ (- -1.0 x) B))))))
      double code(double F, double B, double x) {
      	double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (2.0 * x)), (-1.0 / 2.0)));
      	double t_1 = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, -(x / tan(B)));
      	double tmp;
      	if (t_0 <= -5e+19) {
      		tmp = t_1;
      	} else if (t_0 <= 10.0) {
      		tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
      	} else if (t_0 <= 2e+284) {
      		tmp = t_1;
      	} else {
      		tmp = (-1.0 - x) / B;
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
      	t_1 = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, Float64(-Float64(x / tan(B))))
      	tmp = 0.0
      	if (t_0 <= -5e+19)
      		tmp = t_1;
      	elseif (t_0 <= 10.0)
      		tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B));
      	elseif (t_0 <= 2e+284)
      		tmp = t_1;
      	else
      		tmp = Float64(Float64(-1.0 - x) / B);
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := Block[{t$95$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[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+19], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+284], t$95$1, N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
      t_1 := \mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\
      \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+19}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_0 \leq 10:\\
      \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
      
      \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+284}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-1 - x}{B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -5e19 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2.00000000000000016e284

        1. Initial program 97.7%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          4. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          5. clear-numN/A

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

            \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          7. associate-*l*N/A

            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          8. lower-fma.f64N/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \color{blue}{\left(\frac{-1}{6} \cdot {B}^{2} + 1\right)}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
          2. distribute-lft-inN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + B \cdot 1\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
          3. *-rgt-identityN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + \color{blue}{B}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
          4. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{fma}\left(B, \frac{-1}{6} \cdot {B}^{2}, B\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
          6. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
          7. unpow2N/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{\left(B \cdot B\right)} \cdot \frac{-1}{6}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
          8. lower-*.f6498.6

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

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

        if -5e19 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

        1. Initial program 83.5%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          4. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          5. clear-numN/A

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

            \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          7. associate-*l*N/A

            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          8. lower-fma.f64N/A

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

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

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

          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
        7. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
          2. lower-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
          3. lower-sqrt.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          5. associate-+r+N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          6. +-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          7. associate-+l+N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          8. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left(2 + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          9. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          10. +-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          11. unpow2N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          12. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
          13. lower-neg.f6457.3

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{\sin B} \]
        8. Applied rewrites57.3%

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

        if 2.00000000000000016e284 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

        1. Initial program 23.7%

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

          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
          2. sub-negN/A

            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
          3. lower-fma.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
          4. lower-sqrt.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          5. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          6. +-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          7. associate-+l+N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          8. *-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          9. +-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          10. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          11. +-commutativeN/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          12. unpow2N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          13. lower-fma.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
          14. lower-neg.f6453.8

            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
        5. Applied rewrites53.8%

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

          \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
        7. Step-by-step derivation
          1. Applied rewrites81.7%

            \[\leadsto \frac{-1 - x}{B} \]
        8. Recombined 3 regimes into one program.
        9. Final simplification81.9%

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

        Alternative 3: 78.0% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{-1}{\tan B}\\ t_1 := t\_0 + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\ t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ t_3 := t\_0 + t\_2 \cdot \frac{F}{B}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+19}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, t\_2, -x\right)}{\sin B}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0 (* x (/ -1.0 (tan B))))
                (t_1
                 (+
                  t_0
                  (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) (/ -1.0 2.0)))))
                (t_2 (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))))
                (t_3 (+ t_0 (* t_2 (/ F B)))))
           (if (<= t_1 -5e+19)
             t_3
             (if (<= t_1 10.0)
               (/ (fma F t_2 (- x)) (sin B))
               (if (<= t_1 2e+284) t_3 (/ (- -1.0 x) B))))))
        double code(double F, double B, double x) {
        	double t_0 = x * (-1.0 / tan(B));
        	double t_1 = t_0 + ((F / sin(B)) * pow(((2.0 + (F * F)) + (2.0 * x)), (-1.0 / 2.0)));
        	double t_2 = sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))));
        	double t_3 = t_0 + (t_2 * (F / B));
        	double tmp;
        	if (t_1 <= -5e+19) {
        		tmp = t_3;
        	} else if (t_1 <= 10.0) {
        		tmp = fma(F, t_2, -x) / sin(B);
        	} else if (t_1 <= 2e+284) {
        		tmp = t_3;
        	} else {
        		tmp = (-1.0 - x) / B;
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	t_0 = Float64(x * Float64(-1.0 / tan(B)))
        	t_1 = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0))))
        	t_2 = sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0))))
        	t_3 = Float64(t_0 + Float64(t_2 * Float64(F / B)))
        	tmp = 0.0
        	if (t_1 <= -5e+19)
        		tmp = t_3;
        	elseif (t_1 <= 10.0)
        		tmp = Float64(fma(F, t_2, Float64(-x)) / sin(B));
        	elseif (t_1 <= 2e+284)
        		tmp = t_3;
        	else
        		tmp = Float64(Float64(-1.0 - x) / B);
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(t$95$2 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+19], t$95$3, If[LessEqual[t$95$1, 10.0], N[(N[(F * t$95$2 + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+284], t$95$3, N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := x \cdot \frac{-1}{\tan B}\\
        t_1 := t\_0 + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
        t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
        t_3 := t\_0 + t\_2 \cdot \frac{F}{B}\\
        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+19}:\\
        \;\;\;\;t\_3\\
        
        \mathbf{elif}\;t\_1 \leq 10:\\
        \;\;\;\;\frac{\mathsf{fma}\left(F, t\_2, -x\right)}{\sin B}\\
        
        \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
        \;\;\;\;t\_3\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{-1 - x}{B}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -5e19 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2.00000000000000016e284

          1. Initial program 97.7%

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

            \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} \]
            2. lower-*.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot \frac{F}{B}} \]
            3. lower-sqrt.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} \]
            4. lower-/.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \cdot \frac{F}{B} \]
            5. +-commutativeN/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}} \cdot \frac{F}{B} \]
            6. associate-+l+N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}} \cdot \frac{F}{B} \]
            7. *-commutativeN/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}} \cdot \frac{F}{B} \]
            8. +-commutativeN/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}} \cdot \frac{F}{B} \]
            9. lower-fma.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}} \cdot \frac{F}{B} \]
            10. +-commutativeN/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}} \cdot \frac{F}{B} \]
            11. unpow2N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}} \cdot \frac{F}{B} \]
            12. lower-fma.f64N/A

              \[\leadsto \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) + \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}} \cdot \frac{F}{B} \]
            13. lower-/.f6497.7

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

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

          if -5e19 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

          1. Initial program 83.5%

            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
            3. lift-*.f64N/A

              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
            4. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
            5. clear-numN/A

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

              \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
            7. associate-*l*N/A

              \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
            8. lower-fma.f64N/A

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

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

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

            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
          7. Step-by-step derivation
            1. sub-negN/A

              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
            2. lower-fma.f64N/A

              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
            3. lower-sqrt.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            5. associate-+r+N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            6. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            7. associate-+l+N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            8. *-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left(2 + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            9. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            10. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            11. unpow2N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            12. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
            13. lower-neg.f6457.3

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{\sin B} \]
          8. Applied rewrites57.3%

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

          if 2.00000000000000016e284 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

          1. Initial program 23.7%

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

            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
            2. sub-negN/A

              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
            3. lower-fma.f64N/A

              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
            4. lower-sqrt.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            5. lower-/.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            6. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            7. associate-+l+N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            8. *-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            9. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            10. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            11. +-commutativeN/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            12. unpow2N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            13. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
            14. lower-neg.f6453.8

              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
          5. Applied rewrites53.8%

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

            \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
          7. Step-by-step derivation
            1. Applied rewrites81.7%

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

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

          Alternative 4: 99.7% 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 -3.35 \cdot 10^{+40}:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2000000:\\ \;\;\;\;\mathsf{fma}\left(F, t\_0 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\ \end{array} \end{array} \]
          (FPCore (F B x)
           :precision binary64
           (let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x (tan B)))))
             (if (<= F -3.35e+40)
               (/ (- -1.0 (* x (cos B))) (sin B))
               (if (<= F 2000000.0)
                 (fma F (* t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5)) t_1)
                 (fma t_0 1.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 <= -3.35e+40) {
          		tmp = (-1.0 - (x * cos(B))) / sin(B);
          	} else if (F <= 2000000.0) {
          		tmp = fma(F, (t_0 * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)), t_1);
          	} else {
          		tmp = fma(t_0, 1.0, t_1);
          	}
          	return tmp;
          }
          
          function code(F, B, x)
          	t_0 = Float64(1.0 / sin(B))
          	t_1 = Float64(-Float64(x / tan(B)))
          	tmp = 0.0
          	if (F <= -3.35e+40)
          		tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B));
          	elseif (F <= 2000000.0)
          		tmp = fma(F, Float64(t_0 * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)), t_1);
          	else
          		tmp = fma(t_0, 1.0, t_1);
          	end
          	return 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, -3.35e+40], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2000000.0], N[(F * N[(t$95$0 * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.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 -3.35 \cdot 10^{+40}:\\
          \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
          
          \mathbf{elif}\;F \leq 2000000:\\
          \;\;\;\;\mathsf{fma}\left(F, t\_0 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, t\_1\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if F < -3.35000000000000011e40

            1. Initial program 60.0%

              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              4. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              5. clear-numN/A

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

                \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              7. associate-*l*N/A

                \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              8. lower-fma.f64N/A

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

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

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

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

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

              if -3.35000000000000011e40 < F < 2e6

              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. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                3. lift-*.f64N/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                5. div-invN/A

                  \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                6. associate-*l*N/A

                  \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                7. lower-fma.f64N/A

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

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

              if 2e6 < F

              1. Initial program 64.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. lift-+.f64N/A

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                3. lift-*.f64N/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                5. clear-numN/A

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

                  \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                7. associate-*l*N/A

                  \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                8. lower-fma.f64N/A

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

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

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

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

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

              Alternative 5: 99.7% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{x}{\tan B}\\ \mathbf{if}\;F \leq -300000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (let* ((t_0 (- (/ x (tan B)))))
                 (if (<= F -300000000.0)
                   (/ (- -1.0 (* x (cos B))) (sin B))
                   (if (<= F 2000000.0)
                     (fma (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) F t_0)
                     (fma (/ 1.0 (sin B)) 1.0 t_0)))))
              double code(double F, double B, double x) {
              	double t_0 = -(x / tan(B));
              	double tmp;
              	if (F <= -300000000.0) {
              		tmp = (-1.0 - (x * cos(B))) / sin(B);
              	} else if (F <= 2000000.0) {
              		tmp = fma((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), F, t_0);
              	} else {
              		tmp = fma((1.0 / sin(B)), 1.0, t_0);
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	t_0 = Float64(-Float64(x / tan(B)))
              	tmp = 0.0
              	if (F <= -300000000.0)
              		tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B));
              	elseif (F <= 2000000.0)
              		tmp = fma(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, t_0);
              	else
              		tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0);
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -300000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2000000.0], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := -\frac{x}{\tan B}\\
              \mathbf{if}\;F \leq -300000000:\\
              \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
              
              \mathbf{elif}\;F \leq 2000000:\\
              \;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, t\_0\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if F < -3e8

                1. Initial program 64.1%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-+.f64N/A

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

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  4. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  5. clear-numN/A

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

                    \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  7. associate-*l*N/A

                    \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  8. lower-fma.f64N/A

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

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

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

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

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

                  if -3e8 < F < 2e6

                  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. lift-+.f64N/A

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

                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                    3. lift-*.f64N/A

                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    5. lift-/.f64N/A

                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    6. clear-numN/A

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

                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    8. associate-*r*N/A

                      \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    9. div-invN/A

                      \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \cdot F + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    10. lower-fma.f64N/A

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

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

                  if 2e6 < F

                  1. Initial program 64.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. lift-+.f64N/A

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

                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                    3. lift-*.f64N/A

                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    4. lift-/.f64N/A

                      \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    5. clear-numN/A

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

                      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    7. associate-*l*N/A

                      \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                    8. lower-fma.f64N/A

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -300000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, -\frac{x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -\frac{x}{\tan B}\right)\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 6: 99.7% accurate, 1.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{x}{\tan B}\\ \mathbf{if}\;F \leq -450000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (let* ((t_0 (- (/ x (tan B)))))
                     (if (<= F -450000000.0)
                       (/ (- -1.0 (* x (cos B))) (sin B))
                       (if (<= F 2000000.0)
                         (fma (/ 1.0 (* (sin B) (sqrt (fma F F (fma 2.0 x 2.0))))) F t_0)
                         (fma (/ 1.0 (sin B)) 1.0 t_0)))))
                  double code(double F, double B, double x) {
                  	double t_0 = -(x / tan(B));
                  	double tmp;
                  	if (F <= -450000000.0) {
                  		tmp = (-1.0 - (x * cos(B))) / sin(B);
                  	} else if (F <= 2000000.0) {
                  		tmp = fma((1.0 / (sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))), F, t_0);
                  	} else {
                  		tmp = fma((1.0 / sin(B)), 1.0, t_0);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	t_0 = Float64(-Float64(x / tan(B)))
                  	tmp = 0.0
                  	if (F <= -450000000.0)
                  		tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B));
                  	elseif (F <= 2000000.0)
                  		tmp = fma(Float64(1.0 / Float64(sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))), F, t_0);
                  	else
                  		tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0);
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -450000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2000000.0], N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := -\frac{x}{\tan B}\\
                  \mathbf{if}\;F \leq -450000000:\\
                  \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 2000000:\\
                  \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, t\_0\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if F < -4.5e8

                    1. Initial program 64.1%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. lift-+.f64N/A

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

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                      3. lift-*.f64N/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      4. lift-/.f64N/A

                        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      5. clear-numN/A

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

                        \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      7. associate-*l*N/A

                        \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                      8. lower-fma.f64N/A

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

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

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

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

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

                      if -4.5e8 < F < 2e6

                      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. lift-+.f64N/A

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

                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                        3. lift-*.f64N/A

                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        4. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        5. clear-numN/A

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

                          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        8. lower-fma.f64N/A

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

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

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

                      if 2e6 < F

                      1. Initial program 64.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. lift-+.f64N/A

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

                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                        3. lift-*.f64N/A

                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        4. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        5. clear-numN/A

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

                          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        7. associate-*l*N/A

                          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                        8. lower-fma.f64N/A

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

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -450000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 2000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -\frac{x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -\frac{x}{\tan B}\right)\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 7: 99.6% accurate, 1.4× speedup?

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

                        1. Initial program 37.9%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Add Preprocessing
                        3. Step-by-step derivation
                          1. lift-+.f64N/A

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

                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                          3. lift-*.f64N/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          4. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          5. clear-numN/A

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

                            \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          7. associate-*l*N/A

                            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                          8. lower-fma.f64N/A

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

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

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

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

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

                          if -1.00000000000000001e155 < F < 1.00000000000000001e41

                          1. Initial program 96.5%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-+.f64N/A

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

                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            4. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            5. clear-numN/A

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

                              \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            7. associate-*l*N/A

                              \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            8. lower-fma.f64N/A

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

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

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

                          if 1.00000000000000001e41 < F

                          1. Initial program 60.8%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-+.f64N/A

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

                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            4. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            5. clear-numN/A

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

                              \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            7. associate-*l*N/A

                              \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                            8. lower-fma.f64N/A

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

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

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

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

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

                          Alternative 8: 99.6% accurate, 1.4× speedup?

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

                            1. Initial program 37.9%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. lift-+.f64N/A

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

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                              3. lift-*.f64N/A

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              4. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              5. clear-numN/A

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

                                \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              7. associate-*l*N/A

                                \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                              8. lower-fma.f64N/A

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

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

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

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

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

                              if -1.00000000000000001e155 < F < 1.00000000000000001e41

                              1. Initial program 96.5%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-+.f64N/A

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

                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                4. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                5. clear-numN/A

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

                                  \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                7. associate-*l*N/A

                                  \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                8. lower-fma.f64N/A

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

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

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

                                \[\leadsto \frac{\frac{F}{\sqrt{\color{blue}{2 + {F}^{2}}}} - x \cdot \cos B}{\sin B} \]
                              7. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \frac{\frac{F}{\sqrt{\color{blue}{{F}^{2} + 2}}} - x \cdot \cos B}{\sin B} \]
                                2. unpow2N/A

                                  \[\leadsto \frac{\frac{F}{\sqrt{\color{blue}{F \cdot F} + 2}} - x \cdot \cos B}{\sin B} \]
                                3. lower-fma.f6498.9

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

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

                              if 1.00000000000000001e41 < F

                              1. Initial program 60.8%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-+.f64N/A

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

                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                4. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                5. clear-numN/A

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

                                  \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                7. associate-*l*N/A

                                  \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                8. lower-fma.f64N/A

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

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

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

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

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

                              Alternative 9: 92.7% accurate, 1.5× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{x}{\tan B}\\ \mathbf{if}\;F \leq -265000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, t\_0\right)\\ \mathbf{elif}\;F \leq 1300000:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\ \end{array} \end{array} \]
                              (FPCore (F B x)
                               :precision binary64
                               (let* ((t_0 (- (/ x (tan B)))))
                                 (if (<= F -265000000.0)
                                   (/ (- -1.0 (* x (cos B))) (sin B))
                                   (if (<= F 6.5e-78)
                                     (fma
                                      (/
                                       1.0
                                       (*
                                        (sqrt (fma F F (fma 2.0 x 2.0)))
                                        (fma B (* (* B B) -0.16666666666666666) B)))
                                      F
                                      t_0)
                                     (if (<= F 1300000.0)
                                       (/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
                                       (fma (/ 1.0 (sin B)) 1.0 t_0))))))
                              double code(double F, double B, double x) {
                              	double t_0 = -(x / tan(B));
                              	double tmp;
                              	if (F <= -265000000.0) {
                              		tmp = (-1.0 - (x * cos(B))) / sin(B);
                              	} else if (F <= 6.5e-78) {
                              		tmp = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, t_0);
                              	} else if (F <= 1300000.0) {
                              		tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
                              	} else {
                              		tmp = fma((1.0 / sin(B)), 1.0, t_0);
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	t_0 = Float64(-Float64(x / tan(B)))
                              	tmp = 0.0
                              	if (F <= -265000000.0)
                              		tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B));
                              	elseif (F <= 6.5e-78)
                              		tmp = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, t_0);
                              	elseif (F <= 1300000.0)
                              		tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B));
                              	else
                              		tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0);
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -265000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-78], N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], If[LessEqual[F, 1300000.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := -\frac{x}{\tan B}\\
                              \mathbf{if}\;F \leq -265000000:\\
                              \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
                              
                              \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\
                              \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, t\_0\right)\\
                              
                              \mathbf{elif}\;F \leq 1300000:\\
                              \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 4 regimes
                              2. if F < -2.65e8

                                1. Initial program 64.1%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-+.f64N/A

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

                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                  3. lift-*.f64N/A

                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  4. lift-/.f64N/A

                                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  5. clear-numN/A

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

                                    \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  7. associate-*l*N/A

                                    \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                  8. lower-fma.f64N/A

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

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

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

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

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

                                  if -2.65e8 < F < 6.5000000000000003e-78

                                  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. lift-+.f64N/A

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

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    4. lift-/.f64N/A

                                      \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    5. clear-numN/A

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

                                      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    7. associate-*l*N/A

                                      \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    8. lower-fma.f64N/A

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                  7. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \color{blue}{\left(\frac{-1}{6} \cdot {B}^{2} + 1\right)}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                    2. distribute-lft-inN/A

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + B \cdot 1\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                    3. *-rgt-identityN/A

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + \color{blue}{B}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                    4. lower-fma.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{fma}\left(B, \frac{-1}{6} \cdot {B}^{2}, B\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                    5. *-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                    6. lower-*.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                    7. unpow2N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{\left(B \cdot B\right)} \cdot \frac{-1}{6}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                    8. lower-*.f6485.7

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

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

                                  if 6.5000000000000003e-78 < F < 1.3e6

                                  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. lift-+.f64N/A

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

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    4. lift-/.f64N/A

                                      \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    5. clear-numN/A

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

                                      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    7. associate-*l*N/A

                                      \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    8. lower-fma.f64N/A

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

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

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

                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
                                  7. Step-by-step derivation
                                    1. sub-negN/A

                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                    2. lower-fma.f64N/A

                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                    3. lower-sqrt.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    4. lower-/.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    5. associate-+r+N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    6. +-commutativeN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    7. associate-+l+N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    8. *-commutativeN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left(2 + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    9. lower-fma.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    10. +-commutativeN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    11. unpow2N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    12. lower-fma.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                    13. lower-neg.f6489.0

                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{\sin B} \]
                                  8. Applied rewrites89.0%

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

                                  if 1.3e6 < F

                                  1. Initial program 64.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. lift-+.f64N/A

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

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    4. lift-/.f64N/A

                                      \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    5. clear-numN/A

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

                                      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    7. associate-*l*N/A

                                      \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                    8. lower-fma.f64N/A

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, \frac{-x}{\tan B}\right) \]
                                  7. Recombined 4 regimes into one program.
                                  8. Final simplification93.0%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -265000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1300000:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -\frac{x}{\tan B}\right)\\ \end{array} \]
                                  9. Add Preprocessing

                                  Alternative 10: 92.7% accurate, 1.5× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \cos B\\ \mathbf{if}\;F \leq -265000000:\\ \;\;\;\;\frac{-1 - t\_0}{\sin B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1300000:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - t\_0}{\sin B}\\ \end{array} \end{array} \]
                                  (FPCore (F B x)
                                   :precision binary64
                                   (let* ((t_0 (* x (cos B))))
                                     (if (<= F -265000000.0)
                                       (/ (- -1.0 t_0) (sin B))
                                       (if (<= F 6.5e-78)
                                         (fma
                                          (/
                                           1.0
                                           (*
                                            (sqrt (fma F F (fma 2.0 x 2.0)))
                                            (fma B (* (* B B) -0.16666666666666666) B)))
                                          F
                                          (- (/ x (tan B))))
                                         (if (<= F 1300000.0)
                                           (/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
                                           (/ (- 1.0 t_0) (sin B)))))))
                                  double code(double F, double B, double x) {
                                  	double t_0 = x * cos(B);
                                  	double tmp;
                                  	if (F <= -265000000.0) {
                                  		tmp = (-1.0 - t_0) / sin(B);
                                  	} else if (F <= 6.5e-78) {
                                  		tmp = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, -(x / tan(B)));
                                  	} else if (F <= 1300000.0) {
                                  		tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
                                  	} else {
                                  		tmp = (1.0 - t_0) / sin(B);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(F, B, x)
                                  	t_0 = Float64(x * cos(B))
                                  	tmp = 0.0
                                  	if (F <= -265000000.0)
                                  		tmp = Float64(Float64(-1.0 - t_0) / sin(B));
                                  	elseif (F <= 6.5e-78)
                                  		tmp = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, Float64(-Float64(x / tan(B))));
                                  	elseif (F <= 1300000.0)
                                  		tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B));
                                  	else
                                  		tmp = Float64(Float64(1.0 - t_0) / sin(B));
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -265000000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-78], N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1300000.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_0 := x \cdot \cos B\\
                                  \mathbf{if}\;F \leq -265000000:\\
                                  \;\;\;\;\frac{-1 - t\_0}{\sin B}\\
                                  
                                  \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\
                                  \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\
                                  
                                  \mathbf{elif}\;F \leq 1300000:\\
                                  \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{1 - t\_0}{\sin B}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 4 regimes
                                  2. if F < -2.65e8

                                    1. Initial program 64.1%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Step-by-step derivation
                                      1. lift-+.f64N/A

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

                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                      3. lift-*.f64N/A

                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      4. lift-/.f64N/A

                                        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      5. clear-numN/A

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

                                        \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      7. associate-*l*N/A

                                        \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                      8. lower-fma.f64N/A

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

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

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

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

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

                                      if -2.65e8 < F < 6.5000000000000003e-78

                                      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. lift-+.f64N/A

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

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                        3. lift-*.f64N/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        4. lift-/.f64N/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        5. clear-numN/A

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

                                          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        7. associate-*l*N/A

                                          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        8. lower-fma.f64N/A

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

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

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

                                        \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                      7. Step-by-step derivation
                                        1. +-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \color{blue}{\left(\frac{-1}{6} \cdot {B}^{2} + 1\right)}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                        2. distribute-lft-inN/A

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + B \cdot 1\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                        3. *-rgt-identityN/A

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + \color{blue}{B}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                        4. lower-fma.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{fma}\left(B, \frac{-1}{6} \cdot {B}^{2}, B\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                        5. *-commutativeN/A

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                        6. lower-*.f64N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                        7. unpow2N/A

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{\left(B \cdot B\right)} \cdot \frac{-1}{6}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                        8. lower-*.f6485.7

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

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

                                      if 6.5000000000000003e-78 < F < 1.3e6

                                      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. lift-+.f64N/A

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

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                        3. lift-*.f64N/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        4. lift-/.f64N/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        5. clear-numN/A

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

                                          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        7. associate-*l*N/A

                                          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        8. lower-fma.f64N/A

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

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

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

                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
                                      7. Step-by-step derivation
                                        1. sub-negN/A

                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                        2. lower-fma.f64N/A

                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                        3. lower-sqrt.f64N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        4. lower-/.f64N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        5. associate-+r+N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        6. +-commutativeN/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        7. associate-+l+N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        8. *-commutativeN/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left(2 + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        9. lower-fma.f64N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        10. +-commutativeN/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        11. unpow2N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        12. lower-fma.f64N/A

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                        13. lower-neg.f6489.0

                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{\sin B} \]
                                      8. Applied rewrites89.0%

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

                                      if 1.3e6 < F

                                      1. Initial program 64.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. lift-+.f64N/A

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

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                        3. lift-*.f64N/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        4. lift-/.f64N/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        5. clear-numN/A

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

                                          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        7. associate-*l*N/A

                                          \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                        8. lower-fma.f64N/A

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

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

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

                                        \[\leadsto \frac{\color{blue}{1} - x \cdot \cos B}{\sin B} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites99.6%

                                          \[\leadsto \frac{\color{blue}{1} - x \cdot \cos B}{\sin B} \]
                                      8. Recombined 4 regimes into one program.
                                      9. Final simplification93.0%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -265000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1300000:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 11: 81.6% accurate, 1.6× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -265000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1.36 \cdot 10^{+116}:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\ \end{array} \end{array} \]
                                      (FPCore (F B x)
                                       :precision binary64
                                       (if (<= F -265000000.0)
                                         (/ (- -1.0 (* x (cos B))) (sin B))
                                         (if (<= F 6.5e-78)
                                           (fma
                                            (/
                                             1.0
                                             (*
                                              (sqrt (fma F F (fma 2.0 x 2.0)))
                                              (fma B (* (* B B) -0.16666666666666666) B)))
                                            F
                                            (- (/ x (tan B))))
                                           (if (<= F 1.36e+116)
                                             (/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
                                             (/ -1.0 (/ (tan B) x))))))
                                      double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -265000000.0) {
                                      		tmp = (-1.0 - (x * cos(B))) / sin(B);
                                      	} else if (F <= 6.5e-78) {
                                      		tmp = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, -(x / tan(B)));
                                      	} else if (F <= 1.36e+116) {
                                      		tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
                                      	} else {
                                      		tmp = -1.0 / (tan(B) / x);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(F, B, x)
                                      	tmp = 0.0
                                      	if (F <= -265000000.0)
                                      		tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B));
                                      	elseif (F <= 6.5e-78)
                                      		tmp = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, Float64(-Float64(x / tan(B))));
                                      	elseif (F <= 1.36e+116)
                                      		tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B));
                                      	else
                                      		tmp = Float64(-1.0 / Float64(tan(B) / x));
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[F_, B_, x_] := If[LessEqual[F, -265000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-78], N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.36e+116], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;F \leq -265000000:\\
                                      \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
                                      
                                      \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\
                                      \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\
                                      
                                      \mathbf{elif}\;F \leq 1.36 \cdot 10^{+116}:\\
                                      \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 4 regimes
                                      2. if F < -2.65e8

                                        1. Initial program 64.1%

                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        2. Add Preprocessing
                                        3. Step-by-step derivation
                                          1. lift-+.f64N/A

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

                                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                          3. lift-*.f64N/A

                                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          4. lift-/.f64N/A

                                            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          5. clear-numN/A

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

                                            \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          7. associate-*l*N/A

                                            \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                          8. lower-fma.f64N/A

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

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

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

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

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

                                          if -2.65e8 < F < 6.5000000000000003e-78

                                          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. lift-+.f64N/A

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

                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                            3. lift-*.f64N/A

                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            4. lift-/.f64N/A

                                              \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            5. clear-numN/A

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

                                              \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            7. associate-*l*N/A

                                              \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            8. lower-fma.f64N/A

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{2}\right)\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                          7. Step-by-step derivation
                                            1. +-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \color{blue}{\left(\frac{-1}{6} \cdot {B}^{2} + 1\right)}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                            2. distribute-lft-inN/A

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + B \cdot 1\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                            3. *-rgt-identityN/A

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\left(B \cdot \left(\frac{-1}{6} \cdot {B}^{2}\right) + \color{blue}{B}\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                            4. lower-fma.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{fma}\left(B, \frac{-1}{6} \cdot {B}^{2}, B\right)} \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                            5. *-commutativeN/A

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                            6. lower-*.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{{B}^{2} \cdot \frac{-1}{6}}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                            7. unpow2N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(B, \color{blue}{\left(B \cdot B\right)} \cdot \frac{-1}{6}, B\right) \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \frac{\mathsf{neg}\left(x\right)}{\tan B}\right) \]
                                            8. lower-*.f6485.7

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

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

                                          if 6.5000000000000003e-78 < F < 1.36e116

                                          1. Initial program 95.0%

                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          2. Add Preprocessing
                                          3. Step-by-step derivation
                                            1. lift-+.f64N/A

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

                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                            3. lift-*.f64N/A

                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            4. lift-/.f64N/A

                                              \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            5. clear-numN/A

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

                                              \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            7. associate-*l*N/A

                                              \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                            8. lower-fma.f64N/A

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

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

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

                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
                                          7. Step-by-step derivation
                                            1. sub-negN/A

                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                            2. lower-fma.f64N/A

                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                            3. lower-sqrt.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            4. lower-/.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            5. associate-+r+N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            6. +-commutativeN/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            7. associate-+l+N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            8. *-commutativeN/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left(2 + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            9. lower-fma.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            10. +-commutativeN/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            11. unpow2N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            12. lower-fma.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                            13. lower-neg.f6484.5

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

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

                                          if 1.36e116 < F

                                          1. Initial program 50.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 x around inf

                                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                          4. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                            2. lower-neg.f64N/A

                                              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                            3. lower-/.f64N/A

                                              \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) \]
                                            4. lower-*.f64N/A

                                              \[\leadsto \mathsf{neg}\left(\frac{\color{blue}{x \cdot \cos B}}{\sin B}\right) \]
                                            5. lower-cos.f64N/A

                                              \[\leadsto \mathsf{neg}\left(\frac{x \cdot \color{blue}{\cos B}}{\sin B}\right) \]
                                            6. lower-sin.f6459.3

                                              \[\leadsto -\frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                          5. Applied rewrites59.3%

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

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

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -265000000:\\ \;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\ \mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1.36 \cdot 10^{+116}:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\ \end{array} \]
                                          9. Add Preprocessing

                                          Alternative 12: 78.1% accurate, 2.2× speedup?

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

                                            1. Initial program 88.0%

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

                                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                            4. Step-by-step derivation
                                              1. mul-1-negN/A

                                                \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                              2. lower-neg.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                              3. lower-/.f64N/A

                                                \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) \]
                                              4. lower-*.f64N/A

                                                \[\leadsto \mathsf{neg}\left(\frac{\color{blue}{x \cdot \cos B}}{\sin B}\right) \]
                                              5. lower-cos.f64N/A

                                                \[\leadsto \mathsf{neg}\left(\frac{x \cdot \color{blue}{\cos B}}{\sin B}\right) \]
                                              6. lower-sin.f6495.4

                                                \[\leadsto -\frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                            5. Applied rewrites95.4%

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

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

                                              if -1.07999999999999995e-29 < x < 2.15000000000000012e-17

                                              1. Initial program 76.9%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Add Preprocessing
                                              3. Step-by-step derivation
                                                1. lift-+.f64N/A

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

                                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                3. lift-*.f64N/A

                                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                4. lift-/.f64N/A

                                                  \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                5. clear-numN/A

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

                                                  \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                7. associate-*l*N/A

                                                  \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                8. lower-fma.f64N/A

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

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

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

                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}}{\sin B} \]
                                              7. Step-by-step derivation
                                                1. sub-negN/A

                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                                2. lower-fma.f64N/A

                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{\sin B} \]
                                                3. lower-sqrt.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                4. lower-/.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                5. associate-+r+N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                6. +-commutativeN/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + 2\right)} + {F}^{2}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                7. associate-+l+N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                8. *-commutativeN/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left(2 + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                9. lower-fma.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                10. +-commutativeN/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                11. unpow2N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                12. lower-fma.f64N/A

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{\sin B} \]
                                                13. lower-neg.f6464.9

                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{\sin B} \]
                                              8. Applied rewrites64.9%

                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}}{\sin B} \]
                                            7. Recombined 2 regimes into one program.
                                            8. Final simplification78.4%

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

                                            Alternative 13: 71.9% accurate, 2.4× speedup?

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

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

                                                \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                              4. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                2. lower-neg.f64N/A

                                                  \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                3. lower-/.f64N/A

                                                  \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) \]
                                                4. lower-*.f64N/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{\color{blue}{x \cdot \cos B}}{\sin B}\right) \]
                                                5. lower-cos.f64N/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x \cdot \color{blue}{\cos B}}{\sin B}\right) \]
                                                6. lower-sin.f6486.0

                                                  \[\leadsto -\frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                              5. Applied rewrites86.0%

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

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

                                                if -8.49999999999999931e-30 < x < 4.5e-78

                                                1. Initial program 77.5%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-+.f64N/A

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

                                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                  3. lift-*.f64N/A

                                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                  4. lift-/.f64N/A

                                                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                  5. clear-numN/A

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

                                                    \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                  7. associate-*l*N/A

                                                    \[\leadsto \color{blue}{\frac{1}{\sin B} \cdot \left(F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                                                  8. lower-fma.f64N/A

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

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

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

                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
                                                7. Step-by-step derivation
                                                  1. lower-*.f64N/A

                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
                                                  2. lower-sqrt.f64N/A

                                                    \[\leadsto \frac{F \cdot \color{blue}{\sqrt{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
                                                  3. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\color{blue}{\frac{1}{2 + {F}^{2}}}}}{\sin B} \]
                                                  4. +-commutativeN/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{\color{blue}{{F}^{2} + 2}}}}{\sin B} \]
                                                  5. unpow2N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{\color{blue}{F \cdot F} + 2}}}{\sin B} \]
                                                  6. lower-fma.f6461.2

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
                                                8. Applied rewrites61.2%

                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}}{\sin B} \]
                                              7. Recombined 2 regimes into one program.
                                              8. Final simplification74.8%

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

                                              Alternative 14: 56.9% accurate, 3.1× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 0.00045:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{\tan B}\\ \end{array} \end{array} \]
                                              (FPCore (F B x)
                                               :precision binary64
                                               (if (<= B 0.00045)
                                                 (/
                                                  (fma
                                                   (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
                                                   (fma 0.16666666666666666 (* F (* B B)) F)
                                                   (fma (* x (* B B)) 0.3333333333333333 (- x)))
                                                  B)
                                                 (- (/ x (tan B)))))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (B <= 0.00045) {
                                              		tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), fma((x * (B * B)), 0.3333333333333333, -x)) / B;
                                              	} else {
                                              		tmp = -(x / tan(B));
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(F, B, x)
                                              	tmp = 0.0
                                              	if (B <= 0.00045)
                                              		tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), fma(Float64(x * Float64(B * B)), 0.3333333333333333, Float64(-x))) / B);
                                              	else
                                              		tmp = Float64(-Float64(x / tan(B)));
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[F_, B_, x_] := If[LessEqual[B, 0.00045], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;B \leq 0.00045:\\
                                              \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;-\frac{x}{\tan B}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if B < 4.4999999999999999e-4

                                                1. Initial program 79.0%

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

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

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

                                                if 4.4999999999999999e-4 < B

                                                1. Initial program 90.7%

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

                                                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                4. Step-by-step derivation
                                                  1. mul-1-negN/A

                                                    \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                  2. lower-neg.f64N/A

                                                    \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                  3. lower-/.f64N/A

                                                    \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) \]
                                                  4. lower-*.f64N/A

                                                    \[\leadsto \mathsf{neg}\left(\frac{\color{blue}{x \cdot \cos B}}{\sin B}\right) \]
                                                  5. lower-cos.f64N/A

                                                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \color{blue}{\cos B}}{\sin B}\right) \]
                                                  6. lower-sin.f6461.6

                                                    \[\leadsto -\frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                                                5. Applied rewrites61.6%

                                                  \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites61.9%

                                                    \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                                7. Recombined 2 regimes into one program.
                                                8. Final simplification57.5%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.00045:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{\tan B}\\ \end{array} \]
                                                9. Add Preprocessing

                                                Alternative 15: 50.6% accurate, 3.8× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 80000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                (FPCore (F B x)
                                                 :precision binary64
                                                 (if (<= F -3.1e-14)
                                                   (/ (- -1.0 x) B)
                                                   (if (<= F 80000000.0)
                                                     (/
                                                      (fma
                                                       (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
                                                       (fma 0.16666666666666666 (* F (* B B)) F)
                                                       (fma (* x (* B B)) 0.3333333333333333 (- x)))
                                                      B)
                                                     (/ (- 1.0 x) B))))
                                                double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -3.1e-14) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else if (F <= 80000000.0) {
                                                		tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), fma((x * (B * B)), 0.3333333333333333, -x)) / B;
                                                	} else {
                                                		tmp = (1.0 - x) / B;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(F, B, x)
                                                	tmp = 0.0
                                                	if (F <= -3.1e-14)
                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                	elseif (F <= 80000000.0)
                                                		tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), fma(Float64(x * Float64(B * B)), 0.3333333333333333, Float64(-x))) / B);
                                                	else
                                                		tmp = Float64(Float64(1.0 - x) / B);
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[F_, B_, x_] := If[LessEqual[F, -3.1e-14], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 80000000.0], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;F \leq -3.1 \cdot 10^{-14}:\\
                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                
                                                \mathbf{elif}\;F \leq 80000000:\\
                                                \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{1 - x}{B}\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 3 regimes
                                                2. if F < -3.10000000000000004e-14

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

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    2. sub-negN/A

                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                    3. lower-fma.f64N/A

                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                    4. lower-sqrt.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    5. lower-/.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    6. +-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    7. associate-+l+N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    8. *-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    9. +-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    10. lower-fma.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    11. +-commutativeN/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    12. unpow2N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    13. lower-fma.f64N/A

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                    14. lower-neg.f6450.0

                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
                                                  5. Applied rewrites50.0%

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

                                                    \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites67.4%

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

                                                    if -3.10000000000000004e-14 < F < 8e7

                                                    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

                                                      \[\leadsto \color{blue}{\frac{\left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + {B}^{2} \cdot \left(\frac{1}{6} \cdot \left(F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}\right) + \frac{1}{3} \cdot x\right)\right) - x}{B}} \]
                                                    4. Applied rewrites46.7%

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

                                                    if 8e7 < F

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

                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                    4. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                      2. sub-negN/A

                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                      3. lower-fma.f64N/A

                                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                      4. lower-sqrt.f64N/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      5. lower-/.f64N/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      6. +-commutativeN/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      7. associate-+l+N/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      8. *-commutativeN/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      9. +-commutativeN/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      10. lower-fma.f64N/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      11. +-commutativeN/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      12. unpow2N/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      13. lower-fma.f64N/A

                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                      14. lower-neg.f6431.4

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

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

                                                      \[\leadsto \frac{1 - x}{B} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites44.1%

                                                        \[\leadsto \frac{1 - x}{B} \]
                                                    8. Recombined 3 regimes into one program.
                                                    9. Final simplification51.0%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 80000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \]
                                                    10. Add Preprocessing

                                                    Alternative 16: 51.0% accurate, 6.1× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                    (FPCore (F B x)
                                                     :precision binary64
                                                     (if (<= F -1.45e-5)
                                                       (/ (- -1.0 x) B)
                                                       (if (<= F 2e+20)
                                                         (/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
                                                         (/ (- 1.0 x) B))))
                                                    double code(double F, double B, double x) {
                                                    	double tmp;
                                                    	if (F <= -1.45e-5) {
                                                    		tmp = (-1.0 - x) / B;
                                                    	} else if (F <= 2e+20) {
                                                    		tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B;
                                                    	} else {
                                                    		tmp = (1.0 - x) / B;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    function code(F, B, x)
                                                    	tmp = 0.0
                                                    	if (F <= -1.45e-5)
                                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                                    	elseif (F <= 2e+20)
                                                    		tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B);
                                                    	else
                                                    		tmp = Float64(Float64(1.0 - x) / B);
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    code[F_, B_, x_] := If[LessEqual[F, -1.45e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2e+20], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;F \leq -1.45 \cdot 10^{-5}:\\
                                                    \;\;\;\;\frac{-1 - x}{B}\\
                                                    
                                                    \mathbf{elif}\;F \leq 2 \cdot 10^{+20}:\\
                                                    \;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{1 - x}{B}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if F < -1.45e-5

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

                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                      4. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        2. sub-negN/A

                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                        3. lower-fma.f64N/A

                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                        4. lower-sqrt.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        5. lower-/.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        6. +-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        7. associate-+l+N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        8. *-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        9. +-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        10. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        11. +-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        12. unpow2N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        14. lower-neg.f6450.8

                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
                                                      5. Applied rewrites50.8%

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

                                                        \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites68.5%

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

                                                        if -1.45e-5 < F < 2e20

                                                        1. Initial program 98.6%

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

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-/.f64N/A

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          2. sub-negN/A

                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                          3. lower-fma.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                          4. lower-sqrt.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          5. lower-/.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          6. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          7. associate-+l+N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          8. *-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          9. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          10. lower-fma.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          11. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          12. unpow2N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          13. lower-fma.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          14. lower-neg.f6446.2

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

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

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

                                                        if 2e20 < F

                                                        1. Initial program 63.7%

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

                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                        4. Step-by-step derivation
                                                          1. lower-/.f64N/A

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          2. sub-negN/A

                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                          3. lower-fma.f64N/A

                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                          4. lower-sqrt.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          5. lower-/.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          6. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          7. associate-+l+N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          8. *-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          9. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          10. lower-fma.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          11. +-commutativeN/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          12. unpow2N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          13. lower-fma.f64N/A

                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                          14. lower-neg.f6430.2

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

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

                                                          \[\leadsto \frac{1 - x}{B} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites43.6%

                                                            \[\leadsto \frac{1 - x}{B} \]
                                                        8. Recombined 3 regimes into one program.
                                                        9. Add Preprocessing

                                                        Alternative 17: 50.8% accurate, 8.8× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.45 \cdot 10^{-5}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 0.123:\\ \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{0.5}, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                        (FPCore (F B x)
                                                         :precision binary64
                                                         (if (<= F -1.45e-5)
                                                           (/ (- -1.0 x) B)
                                                           (if (<= F 0.123) (/ (fma F (sqrt 0.5) (- x)) B) (/ (- 1.0 x) B))))
                                                        double code(double F, double B, double x) {
                                                        	double tmp;
                                                        	if (F <= -1.45e-5) {
                                                        		tmp = (-1.0 - x) / B;
                                                        	} else if (F <= 0.123) {
                                                        		tmp = fma(F, sqrt(0.5), -x) / B;
                                                        	} else {
                                                        		tmp = (1.0 - x) / B;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(F, B, x)
                                                        	tmp = 0.0
                                                        	if (F <= -1.45e-5)
                                                        		tmp = Float64(Float64(-1.0 - x) / B);
                                                        	elseif (F <= 0.123)
                                                        		tmp = Float64(fma(F, sqrt(0.5), Float64(-x)) / B);
                                                        	else
                                                        		tmp = Float64(Float64(1.0 - x) / B);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[F_, B_, x_] := If[LessEqual[F, -1.45e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.123], N[(N[(F * N[Sqrt[0.5], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;F \leq -1.45 \cdot 10^{-5}:\\
                                                        \;\;\;\;\frac{-1 - x}{B}\\
                                                        
                                                        \mathbf{elif}\;F \leq 0.123:\\
                                                        \;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{0.5}, -x\right)}{B}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\frac{1 - x}{B}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 3 regimes
                                                        2. if F < -1.45e-5

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

                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            2. sub-negN/A

                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                            3. lower-fma.f64N/A

                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                            4. lower-sqrt.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            5. lower-/.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            6. +-commutativeN/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            7. associate-+l+N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            8. *-commutativeN/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            9. +-commutativeN/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            10. lower-fma.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            11. +-commutativeN/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            12. unpow2N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            13. lower-fma.f64N/A

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            14. lower-neg.f6450.8

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
                                                          5. Applied rewrites50.8%

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

                                                            \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites68.5%

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

                                                            if -1.45e-5 < F < 0.123

                                                            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

                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                            4. Step-by-step derivation
                                                              1. lower-/.f64N/A

                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                              2. sub-negN/A

                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                              3. lower-fma.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                              4. lower-sqrt.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              5. lower-/.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              6. +-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              7. associate-+l+N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              8. *-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              9. +-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              10. lower-fma.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              11. +-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              12. unpow2N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              13. lower-fma.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              14. lower-neg.f6445.5

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

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

                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + 2 \cdot x}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites45.1%

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, 2\right)}}, -x\right)}{B} \]
                                                              2. Taylor expanded in x around 0

                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{2}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites45.1%

                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{0.5}, -x\right)}{B} \]

                                                                if 0.123 < F

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

                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                4. Step-by-step derivation
                                                                  1. lower-/.f64N/A

                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                  2. sub-negN/A

                                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                  3. lower-fma.f64N/A

                                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                  4. lower-sqrt.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  5. lower-/.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  6. +-commutativeN/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  7. associate-+l+N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  8. *-commutativeN/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  9. +-commutativeN/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  10. lower-fma.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  11. +-commutativeN/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  12. unpow2N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  13. lower-fma.f64N/A

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                  14. lower-neg.f6432.9

                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
                                                                5. Applied rewrites32.9%

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

                                                                  \[\leadsto \frac{1 - x}{B} \]
                                                                7. Step-by-step derivation
                                                                  1. Applied rewrites44.3%

                                                                    \[\leadsto \frac{1 - x}{B} \]
                                                                8. Recombined 3 regimes into one program.
                                                                9. Add Preprocessing

                                                                Alternative 18: 42.9% accurate, 9.2× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.2 \cdot 10^{-143}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.05 \cdot 10^{-38}:\\ \;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                (FPCore (F B x)
                                                                 :precision binary64
                                                                 (if (<= F -8.2e-143)
                                                                   (/ (- -1.0 x) B)
                                                                   (if (<= F 1.05e-38)
                                                                     (/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)
                                                                     (/ (- 1.0 x) B))))
                                                                double code(double F, double B, double x) {
                                                                	double tmp;
                                                                	if (F <= -8.2e-143) {
                                                                		tmp = (-1.0 - x) / B;
                                                                	} else if (F <= 1.05e-38) {
                                                                		tmp = (x * fma(0.3333333333333333, (B * B), -1.0)) / B;
                                                                	} else {
                                                                		tmp = (1.0 - x) / B;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                function code(F, B, x)
                                                                	tmp = 0.0
                                                                	if (F <= -8.2e-143)
                                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                                	elseif (F <= 1.05e-38)
                                                                		tmp = Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B);
                                                                	else
                                                                		tmp = Float64(Float64(1.0 - x) / B);
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                code[F_, B_, x_] := If[LessEqual[F, -8.2e-143], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.05e-38], N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;F \leq -8.2 \cdot 10^{-143}:\\
                                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                                
                                                                \mathbf{elif}\;F \leq 1.05 \cdot 10^{-38}:\\
                                                                \;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B}\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\frac{1 - x}{B}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 3 regimes
                                                                2. if F < -8.2e-143

                                                                  1. Initial program 75.6%

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

                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                  4. Step-by-step derivation
                                                                    1. lower-/.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                    2. sub-negN/A

                                                                      \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                    3. lower-fma.f64N/A

                                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                    4. lower-sqrt.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    5. lower-/.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    6. +-commutativeN/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    7. associate-+l+N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    8. *-commutativeN/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    9. +-commutativeN/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    10. lower-fma.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    11. +-commutativeN/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    12. unpow2N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    13. lower-fma.f64N/A

                                                                      \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                    14. lower-neg.f6451.5

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

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

                                                                    \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites52.2%

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

                                                                    if -8.2e-143 < F < 1.05000000000000006e-38

                                                                    1. Initial program 99.4%

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

                                                                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                                                                    4. Step-by-step derivation
                                                                      1. mul-1-negN/A

                                                                        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                      2. lower-neg.f64N/A

                                                                        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right)} \]
                                                                      3. lower-/.f64N/A

                                                                        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{x \cdot \cos B}{\sin B}}\right) \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto \mathsf{neg}\left(\frac{\color{blue}{x \cdot \cos B}}{\sin B}\right) \]
                                                                      5. lower-cos.f64N/A

                                                                        \[\leadsto \mathsf{neg}\left(\frac{x \cdot \color{blue}{\cos B}}{\sin B}\right) \]
                                                                      6. lower-sin.f6471.8

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

                                                                      \[\leadsto \color{blue}{-\frac{x \cdot \cos B}{\sin B}} \]
                                                                    6. Taylor expanded in B around 0

                                                                      \[\leadsto \frac{{B}^{2} \cdot \left(\frac{-1}{6} \cdot x - \frac{-1}{2} \cdot x\right) - x}{\color{blue}{B}} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites30.4%

                                                                        \[\leadsto \frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{\color{blue}{B}} \]

                                                                      if 1.05000000000000006e-38 < F

                                                                      1. Initial program 68.8%

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

                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                      4. Step-by-step derivation
                                                                        1. lower-/.f64N/A

                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                        2. sub-negN/A

                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                        3. lower-fma.f64N/A

                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                        4. lower-sqrt.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        5. lower-/.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        6. +-commutativeN/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        7. associate-+l+N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        8. *-commutativeN/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        9. +-commutativeN/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        10. lower-fma.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        11. +-commutativeN/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        12. unpow2N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        13. lower-fma.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        14. lower-neg.f6435.1

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

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

                                                                        \[\leadsto \frac{1 - x}{B} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites42.1%

                                                                          \[\leadsto \frac{1 - x}{B} \]
                                                                      8. Recombined 3 regimes into one program.
                                                                      9. Add Preprocessing

                                                                      Alternative 19: 43.0% accurate, 13.6× speedup?

                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.2 \cdot 10^{-143}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.95 \cdot 10^{-54}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                      (FPCore (F B x)
                                                                       :precision binary64
                                                                       (if (<= F -8.2e-143)
                                                                         (/ (- -1.0 x) B)
                                                                         (if (<= F 1.95e-54) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                      double code(double F, double B, double x) {
                                                                      	double tmp;
                                                                      	if (F <= -8.2e-143) {
                                                                      		tmp = (-1.0 - x) / B;
                                                                      	} else if (F <= 1.95e-54) {
                                                                      		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 <= (-8.2d-143)) then
                                                                              tmp = ((-1.0d0) - x) / b
                                                                          else if (f <= 1.95d-54) 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 <= -8.2e-143) {
                                                                      		tmp = (-1.0 - x) / B;
                                                                      	} else if (F <= 1.95e-54) {
                                                                      		tmp = -x / B;
                                                                      	} else {
                                                                      		tmp = (1.0 - x) / B;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      def code(F, B, x):
                                                                      	tmp = 0
                                                                      	if F <= -8.2e-143:
                                                                      		tmp = (-1.0 - x) / B
                                                                      	elif F <= 1.95e-54:
                                                                      		tmp = -x / B
                                                                      	else:
                                                                      		tmp = (1.0 - x) / B
                                                                      	return tmp
                                                                      
                                                                      function code(F, B, x)
                                                                      	tmp = 0.0
                                                                      	if (F <= -8.2e-143)
                                                                      		tmp = Float64(Float64(-1.0 - x) / B);
                                                                      	elseif (F <= 1.95e-54)
                                                                      		tmp = Float64(Float64(-x) / B);
                                                                      	else
                                                                      		tmp = Float64(Float64(1.0 - x) / B);
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      function tmp_2 = code(F, B, x)
                                                                      	tmp = 0.0;
                                                                      	if (F <= -8.2e-143)
                                                                      		tmp = (-1.0 - x) / B;
                                                                      	elseif (F <= 1.95e-54)
                                                                      		tmp = -x / B;
                                                                      	else
                                                                      		tmp = (1.0 - x) / B;
                                                                      	end
                                                                      	tmp_2 = tmp;
                                                                      end
                                                                      
                                                                      code[F_, B_, x_] := If[LessEqual[F, -8.2e-143], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-54], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \begin{array}{l}
                                                                      \mathbf{if}\;F \leq -8.2 \cdot 10^{-143}:\\
                                                                      \;\;\;\;\frac{-1 - x}{B}\\
                                                                      
                                                                      \mathbf{elif}\;F \leq 1.95 \cdot 10^{-54}:\\
                                                                      \;\;\;\;\frac{-x}{B}\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\frac{1 - x}{B}\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 3 regimes
                                                                      2. if F < -8.2e-143

                                                                        1. Initial program 75.6%

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

                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                          2. sub-negN/A

                                                                            \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                          3. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                          4. lower-sqrt.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          5. lower-/.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          6. +-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          7. associate-+l+N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          8. *-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          9. +-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          10. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          11. +-commutativeN/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          12. unpow2N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          13. lower-fma.f64N/A

                                                                            \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                          14. lower-neg.f6451.5

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

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

                                                                          \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites52.2%

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

                                                                          if -8.2e-143 < F < 1.95e-54

                                                                          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

                                                                            \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                          4. Step-by-step derivation
                                                                            1. lower-/.f64N/A

                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                            2. sub-negN/A

                                                                              \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                            3. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                            4. lower-sqrt.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            5. lower-/.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            6. +-commutativeN/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            7. associate-+l+N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            8. *-commutativeN/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            9. +-commutativeN/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            10. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            11. +-commutativeN/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            12. unpow2N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            13. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            14. lower-neg.f6442.4

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

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

                                                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites29.7%

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

                                                                            if 1.95e-54 < F

                                                                            1. Initial program 70.5%

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

                                                                              \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                            4. Step-by-step derivation
                                                                              1. lower-/.f64N/A

                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                              2. sub-negN/A

                                                                                \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                              3. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                              4. lower-sqrt.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              5. lower-/.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              6. +-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              7. associate-+l+N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              8. *-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              9. +-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              10. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              11. +-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              12. unpow2N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              13. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              14. lower-neg.f6435.5

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

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

                                                                              \[\leadsto \frac{1 - x}{B} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites41.1%

                                                                                \[\leadsto \frac{1 - x}{B} \]
                                                                            8. Recombined 3 regimes into one program.
                                                                            9. Add Preprocessing

                                                                            Alternative 20: 31.1% accurate, 14.1× speedup?

                                                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{B}\\ \mathbf{if}\;x \leq -1.6 \cdot 10^{-116}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-59}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                            (FPCore (F B x)
                                                                             :precision binary64
                                                                             (let* ((t_0 (/ (- x) B)))
                                                                               (if (<= x -1.6e-116) t_0 (if (<= x 3.8e-59) (/ -1.0 B) t_0))))
                                                                            double code(double F, double B, double x) {
                                                                            	double t_0 = -x / B;
                                                                            	double tmp;
                                                                            	if (x <= -1.6e-116) {
                                                                            		tmp = t_0;
                                                                            	} else if (x <= 3.8e-59) {
                                                                            		tmp = -1.0 / B;
                                                                            	} else {
                                                                            		tmp = t_0;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            real(8) function code(f, b, x)
                                                                                real(8), intent (in) :: f
                                                                                real(8), intent (in) :: b
                                                                                real(8), intent (in) :: x
                                                                                real(8) :: t_0
                                                                                real(8) :: tmp
                                                                                t_0 = -x / b
                                                                                if (x <= (-1.6d-116)) then
                                                                                    tmp = t_0
                                                                                else if (x <= 3.8d-59) then
                                                                                    tmp = (-1.0d0) / b
                                                                                else
                                                                                    tmp = t_0
                                                                                end if
                                                                                code = tmp
                                                                            end function
                                                                            
                                                                            public static double code(double F, double B, double x) {
                                                                            	double t_0 = -x / B;
                                                                            	double tmp;
                                                                            	if (x <= -1.6e-116) {
                                                                            		tmp = t_0;
                                                                            	} else if (x <= 3.8e-59) {
                                                                            		tmp = -1.0 / B;
                                                                            	} else {
                                                                            		tmp = t_0;
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            def code(F, B, x):
                                                                            	t_0 = -x / B
                                                                            	tmp = 0
                                                                            	if x <= -1.6e-116:
                                                                            		tmp = t_0
                                                                            	elif x <= 3.8e-59:
                                                                            		tmp = -1.0 / B
                                                                            	else:
                                                                            		tmp = t_0
                                                                            	return tmp
                                                                            
                                                                            function code(F, B, x)
                                                                            	t_0 = Float64(Float64(-x) / B)
                                                                            	tmp = 0.0
                                                                            	if (x <= -1.6e-116)
                                                                            		tmp = t_0;
                                                                            	elseif (x <= 3.8e-59)
                                                                            		tmp = Float64(-1.0 / B);
                                                                            	else
                                                                            		tmp = t_0;
                                                                            	end
                                                                            	return tmp
                                                                            end
                                                                            
                                                                            function tmp_2 = code(F, B, x)
                                                                            	t_0 = -x / B;
                                                                            	tmp = 0.0;
                                                                            	if (x <= -1.6e-116)
                                                                            		tmp = t_0;
                                                                            	elseif (x <= 3.8e-59)
                                                                            		tmp = -1.0 / B;
                                                                            	else
                                                                            		tmp = t_0;
                                                                            	end
                                                                            	tmp_2 = tmp;
                                                                            end
                                                                            
                                                                            code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -1.6e-116], t$95$0, If[LessEqual[x, 3.8e-59], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
                                                                            
                                                                            \begin{array}{l}
                                                                            
                                                                            \\
                                                                            \begin{array}{l}
                                                                            t_0 := \frac{-x}{B}\\
                                                                            \mathbf{if}\;x \leq -1.6 \cdot 10^{-116}:\\
                                                                            \;\;\;\;t\_0\\
                                                                            
                                                                            \mathbf{elif}\;x \leq 3.8 \cdot 10^{-59}:\\
                                                                            \;\;\;\;\frac{-1}{B}\\
                                                                            
                                                                            \mathbf{else}:\\
                                                                            \;\;\;\;t\_0\\
                                                                            
                                                                            
                                                                            \end{array}
                                                                            \end{array}
                                                                            
                                                                            Derivation
                                                                            1. Split input into 2 regimes
                                                                            2. if x < -1.60000000000000005e-116 or 3.79999999999999983e-59 < x

                                                                              1. Initial program 84.5%

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

                                                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                              4. Step-by-step derivation
                                                                                1. lower-/.f64N/A

                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                2. sub-negN/A

                                                                                  \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                3. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                4. lower-sqrt.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                5. lower-/.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                6. +-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                7. associate-+l+N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                8. *-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                9. +-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                10. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                12. unpow2N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                13. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                14. lower-neg.f6446.0

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
                                                                              5. Applied rewrites46.0%

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

                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites40.3%

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

                                                                                if -1.60000000000000005e-116 < x < 3.79999999999999983e-59

                                                                                1. Initial program 78.1%

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

                                                                                  \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                4. Step-by-step derivation
                                                                                  1. lower-/.f64N/A

                                                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                  2. sub-negN/A

                                                                                    \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                  3. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                  4. lower-sqrt.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  5. lower-/.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  6. +-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  7. associate-+l+N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  8. *-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  9. +-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  10. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  11. +-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  12. unpow2N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  13. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  14. lower-neg.f6439.2

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

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

                                                                                  \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites20.1%

                                                                                    \[\leadsto \frac{-1 - x}{B} \]
                                                                                  2. Taylor expanded in x around 0

                                                                                    \[\leadsto \frac{-1}{B} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites20.1%

                                                                                      \[\leadsto \frac{-1}{B} \]
                                                                                  4. Recombined 2 regimes into one program.
                                                                                  5. Add Preprocessing

                                                                                  Alternative 21: 36.0% accurate, 17.5× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6 \cdot 10^{-143}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                                  (FPCore (F B x)
                                                                                   :precision binary64
                                                                                   (if (<= F -6e-143) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                                  double code(double F, double B, double x) {
                                                                                  	double tmp;
                                                                                  	if (F <= -6e-143) {
                                                                                  		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 <= (-6d-143)) 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 <= -6e-143) {
                                                                                  		tmp = (-1.0 - x) / B;
                                                                                  	} else {
                                                                                  		tmp = -x / B;
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  def code(F, B, x):
                                                                                  	tmp = 0
                                                                                  	if F <= -6e-143:
                                                                                  		tmp = (-1.0 - x) / B
                                                                                  	else:
                                                                                  		tmp = -x / B
                                                                                  	return tmp
                                                                                  
                                                                                  function code(F, B, x)
                                                                                  	tmp = 0.0
                                                                                  	if (F <= -6e-143)
                                                                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                                                                  	else
                                                                                  		tmp = Float64(Float64(-x) / B);
                                                                                  	end
                                                                                  	return tmp
                                                                                  end
                                                                                  
                                                                                  function tmp_2 = code(F, B, x)
                                                                                  	tmp = 0.0;
                                                                                  	if (F <= -6e-143)
                                                                                  		tmp = (-1.0 - x) / B;
                                                                                  	else
                                                                                  		tmp = -x / B;
                                                                                  	end
                                                                                  	tmp_2 = tmp;
                                                                                  end
                                                                                  
                                                                                  code[F_, B_, x_] := If[LessEqual[F, -6e-143], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  \mathbf{if}\;F \leq -6 \cdot 10^{-143}:\\
                                                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;\frac{-x}{B}\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 2 regimes
                                                                                  2. if F < -5.9999999999999997e-143

                                                                                    1. Initial program 75.9%

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

                                                                                      \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. lower-/.f64N/A

                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                      2. sub-negN/A

                                                                                        \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                      3. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                      4. lower-sqrt.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      5. lower-/.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      6. +-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      7. associate-+l+N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      8. *-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      9. +-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      10. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      11. +-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      12. unpow2N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      13. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      14. lower-neg.f6450.9

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \color{blue}{-x}\right)}{B} \]
                                                                                    5. Applied rewrites50.9%

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

                                                                                      \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                                    7. Step-by-step derivation
                                                                                      1. Applied rewrites51.7%

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

                                                                                      if -5.9999999999999997e-143 < F

                                                                                      1. Initial program 84.9%

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

                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                        2. sub-negN/A

                                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                        3. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                        4. lower-sqrt.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        5. lower-/.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        6. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        7. associate-+l+N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        8. *-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        9. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        10. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        11. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        12. unpow2N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        13. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        14. lower-neg.f6439.2

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

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

                                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites25.5%

                                                                                          \[\leadsto \frac{-x}{B} \]
                                                                                      8. Recombined 2 regimes into one program.
                                                                                      9. Add Preprocessing

                                                                                      Alternative 22: 10.3% accurate, 30.7× 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.8%

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

                                                                                        \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                                                        2. sub-negN/A

                                                                                          \[\leadsto \frac{\color{blue}{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} + \left(\mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                        3. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                        4. lower-sqrt.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        5. lower-/.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        6. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\left(2 \cdot x + {F}^{2}\right) + 2}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        7. associate-+l+N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{2 \cdot x + \left({F}^{2} + 2\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        8. *-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{x \cdot 2} + \left({F}^{2} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        9. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{x \cdot 2 + \color{blue}{\left(2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        10. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(x, 2, 2 + {F}^{2}\right)}}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        11. +-commutativeN/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{{F}^{2} + 2}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        12. unpow2N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{F \cdot F} + 2\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        13. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \color{blue}{\mathsf{fma}\left(F, F, 2\right)}\right)}}, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                        14. lower-neg.f6443.2

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

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

                                                                                        \[\leadsto \frac{-1 \cdot \left(1 + x\right)}{B} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites29.9%

                                                                                          \[\leadsto \frac{-1 - x}{B} \]
                                                                                        2. Taylor expanded in x around 0

                                                                                          \[\leadsto \frac{-1}{B} \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites11.6%

                                                                                            \[\leadsto \frac{-1}{B} \]
                                                                                          2. Add Preprocessing

                                                                                          Reproduce

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