VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.6% → 99.7%
Time: 14.6s
Alternatives: 26
Speedup: 2.3×

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

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

Initial Program: 76.6% 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, 0.8× speedup?

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

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

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

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


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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites72.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
      2. lower-sin.f6499.7

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

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

    if -4.9999999999999997e38 < F < 6.5e9

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites99.6%

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

    if 6.5e9 < F

    1. Initial program 54.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites66.9%

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

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-negN/A

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. lower--.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x \cdot \cos B}{\sin B} \]
      6. lower-sin.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\sin B}} - \frac{x \cdot \cos B}{\sin B} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      10. lower-cos.f64N/A

        \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\cos B} \cdot x}{\sin B} \]
      11. lower-sin.f6499.9

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

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

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

Alternative 2: 99.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 63.0%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites71.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
      2. lower-sin.f6499.7

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

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

    if -3.00000000000000017e43 < F < 1e10

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
      4. lower-fma.f6499.4

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

      \[\leadsto \frac{F}{\sin B \cdot \color{blue}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

    if 1e10 < F

    1. Initial program 54.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites66.9%

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

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} + -1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
      2. mul-1-negN/A

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

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. lower--.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x \cdot \cos B}{\sin B} \]
      6. lower-sin.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\sin B}} - \frac{x \cdot \cos B}{\sin B} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
      8. *-commutativeN/A

        \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\cos B \cdot x}}{\sin B} \]
      10. lower-cos.f64N/A

        \[\leadsto \frac{1}{\sin B} - \frac{\color{blue}{\cos B} \cdot x}{\sin B} \]
      11. lower-sin.f6499.9

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

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

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

Alternative 3: 99.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -3 \cdot 10^{+43}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 16600000:\\ \;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;{\sin B}^{-1} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -3e+43)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 16600000.0)
       (- (/ (/ F (sin B)) (sqrt (fma F F 2.0))) t_0)
       (- (pow (sin B) -1.0) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -3e+43) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 16600000.0) {
		tmp = ((F / sin(B)) / sqrt(fma(F, F, 2.0))) - t_0;
	} else {
		tmp = pow(sin(B), -1.0) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -3e+43)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 16600000.0)
		tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(F, F, 2.0))) - t_0);
	else
		tmp = Float64((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, -3e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 16600000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 63.0%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites71.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
      2. lower-sin.f6499.7

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

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

    if -3.00000000000000017e43 < F < 1.66e7

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
      4. lower-fma.f6499.4

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

      \[\leadsto \frac{F}{\sin B \cdot \color{blue}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}} - \frac{x}{\tan B} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

    if 1.66e7 < F

    1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites67.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
      2. lower-sin.f6499.8

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

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

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

Alternative 4: 99.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -2000000000:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 110000000:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;{\sin B}^{-1} - t\_0\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ x (tan B))))
   (if (<= F -2000000000.0)
     (- (/ -1.0 (sin B)) t_0)
     (if (<= F 110000000.0)
       (- (/ F (* (sin B) (sqrt (fma F F 2.0)))) t_0)
       (- (pow (sin B) -1.0) t_0)))))
double code(double F, double B, double x) {
	double t_0 = x / tan(B);
	double tmp;
	if (F <= -2000000000.0) {
		tmp = (-1.0 / sin(B)) - t_0;
	} else if (F <= 110000000.0) {
		tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - t_0;
	} else {
		tmp = pow(sin(B), -1.0) - t_0;
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(x / tan(B))
	tmp = 0.0
	if (F <= -2000000000.0)
		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
	elseif (F <= 110000000.0)
		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - t_0);
	else
		tmp = Float64((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, -2000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites72.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
      2. lower-sin.f6499.7

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

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

    if -2e9 < F < 1.1e8

    1. Initial program 99.3%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
      4. lower-fma.f6499.4

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

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

    if 1.1e8 < F

    1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites67.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
      2. lower-sin.f6499.8

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

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

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

Alternative 5: 99.0% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 66.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites73.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
    8. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
      2. lower-sin.f6499.4

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

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

    if -1.3999999999999999 < F < 1.3999999999999999

    1. Initial program 99.3%

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
    5. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
      4. lower-fma.f6499.4

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

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

      \[\leadsto \frac{F}{\sin B \cdot \sqrt{2}} - \frac{x}{\tan B} \]
    11. Step-by-step derivation
      1. Applied rewrites98.9%

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

      if 1.3999999999999999 < F

      1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites67.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
      5. Step-by-step derivation
        1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
      8. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
        2. lower-sin.f6499.8

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

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

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

    Alternative 6: 90.8% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\tan B}\\ \mathbf{if}\;F \leq -4.1 \cdot 10^{+38}:\\ \;\;\;\;\frac{-1}{\sin B} - t\_0\\ \mathbf{elif}\;F \leq 2.2 \cdot 10^{-15}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{B}, F, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;{\sin B}^{-1} - t\_0\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (let* ((t_0 (/ x (tan B))))
       (if (<= F -4.1e+38)
         (- (/ -1.0 (sin B)) t_0)
         (if (<= F 2.2e-15)
           (fma
            (/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) B)
            F
            (/ (- x) (tan B)))
           (- (pow (sin B) -1.0) t_0)))))
    double code(double F, double B, double x) {
    	double t_0 = x / tan(B);
    	double tmp;
    	if (F <= -4.1e+38) {
    		tmp = (-1.0 / sin(B)) - t_0;
    	} else if (F <= 2.2e-15) {
    		tmp = fma((sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / B), F, (-x / tan(B)));
    	} else {
    		tmp = pow(sin(B), -1.0) - t_0;
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	t_0 = Float64(x / tan(B))
    	tmp = 0.0
    	if (F <= -4.1e+38)
    		tmp = Float64(Float64(-1.0 / sin(B)) - t_0);
    	elseif (F <= 2.2e-15)
    		tmp = fma(Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / B), F, Float64(Float64(-x) / tan(B)));
    	else
    		tmp = Float64((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, -4.1e+38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.2e-15], N[(N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{x}{\tan B}\\
    \mathbf{if}\;F \leq -4.1 \cdot 10^{+38}:\\
    \;\;\;\;\frac{-1}{\sin B} - t\_0\\
    
    \mathbf{elif}\;F \leq 2.2 \cdot 10^{-15}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{B}, F, \frac{-x}{\tan B}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;{\sin B}^{-1} - t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -4.1000000000000003e38

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

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites72.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
      5. Step-by-step derivation
        1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
      8. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
        2. lower-sin.f6499.7

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

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

      if -4.1000000000000003e38 < F < 2.19999999999999986e-15

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

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.19999999999999986e-15 < F

      1. Initial program 58.2%

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

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

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites69.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
      5. Step-by-step derivation
        1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
      8. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\sin B}} - \frac{x}{\tan B} \]
        2. lower-sin.f6496.5

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

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

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

    Alternative 7: 51.3% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(F \cdot F\right) \cdot B\\ \mathbf{if}\;F \leq -1.36 \cdot 10^{+158}:\\ \;\;\;\;\left(\mathsf{fma}\left(\frac{0.16666666666666666}{F}, \frac{\mathsf{fma}\left(x, B, B\right)}{F}, \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B, \frac{x}{t\_0} + {t\_0}^{-1}\right)\right) - {B}^{-1}\right) - \frac{x}{B}\\ \mathbf{elif}\;F \leq 3000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (let* ((t_0 (* (* F F) B)))
       (if (<= F -1.36e+158)
         (-
          (-
           (fma
            (/ 0.16666666666666666 F)
            (/ (fma x B B) F)
            (fma
             (fma 0.3333333333333333 x -0.16666666666666666)
             B
             (+ (/ x t_0) (pow t_0 -1.0))))
           (pow B -1.0))
          (/ x B))
         (if (<= F 3000000000.0)
           (/ (fma (sqrt (pow (fma F F 2.0) -1.0)) F (- x)) B)
           (/
            (- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
            B)))))
    double code(double F, double B, double x) {
    	double t_0 = (F * F) * B;
    	double tmp;
    	if (F <= -1.36e+158) {
    		tmp = (fma((0.16666666666666666 / F), (fma(x, B, B) / F), fma(fma(0.3333333333333333, x, -0.16666666666666666), B, ((x / t_0) + pow(t_0, -1.0)))) - pow(B, -1.0)) - (x / B);
    	} else if (F <= 3000000000.0) {
    		tmp = fma(sqrt(pow(fma(F, F, 2.0), -1.0)), F, -x) / B;
    	} else {
    		tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	t_0 = Float64(Float64(F * F) * B)
    	tmp = 0.0
    	if (F <= -1.36e+158)
    		tmp = Float64(Float64(fma(Float64(0.16666666666666666 / F), Float64(fma(x, B, B) / F), fma(fma(0.3333333333333333, x, -0.16666666666666666), B, Float64(Float64(x / t_0) + (t_0 ^ -1.0)))) - (B ^ -1.0)) - Float64(x / B));
    	elseif (F <= 3000000000.0)
    		tmp = Float64(fma(sqrt((fma(F, F, 2.0) ^ -1.0)), F, Float64(-x)) / B);
    	else
    		tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B);
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]}, If[LessEqual[F, -1.36e+158], N[(N[(N[(N[(0.16666666666666666 / F), $MachinePrecision] * N[(N[(x * B + B), $MachinePrecision] / F), $MachinePrecision] + N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * B + N[(N[(x / t$95$0), $MachinePrecision] + N[Power[t$95$0, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3000000000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(F \cdot F\right) \cdot B\\
    \mathbf{if}\;F \leq -1.36 \cdot 10^{+158}:\\
    \;\;\;\;\left(\mathsf{fma}\left(\frac{0.16666666666666666}{F}, \frac{\mathsf{fma}\left(x, B, B\right)}{F}, \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B, \frac{x}{t\_0} + {t\_0}^{-1}\right)\right) - {B}^{-1}\right) - \frac{x}{B}\\
    
    \mathbf{elif}\;F \leq 3000000000:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -1.35999999999999992e158

      1. Initial program 41.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. *-commutativeN/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
      4. Applied rewrites53.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
      5. Step-by-step derivation
        1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
      7. 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}} \]
      8. Step-by-step derivation
        1. lower-/.f64N/A

          \[\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}} \]
      9. Applied rewrites24.9%

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

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

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

        if -1.35999999999999992e158 < F < 3e9

        1. Initial program 98.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}}, F, -x\right)}{B} \]
        7. Step-by-step derivation
          1. Applied rewrites49.3%

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

          if 3e9 < F

          1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
            4. *-commutativeN/A

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
          4. Applied rewrites67.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
          5. Step-by-step derivation
            1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
          7. 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}} \]
          8. Step-by-step derivation
            1. lower-/.f64N/A

              \[\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}} \]
          9. Applied rewrites35.5%

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

            \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
          11. Step-by-step derivation
            1. Applied rewrites47.5%

              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
          12. Recombined 3 regimes into one program.
          13. Final simplification49.3%

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

          Alternative 8: 78.8% accurate, 1.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -7 \cdot 10^{+77}:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{elif}\;F \leq -4.4 \cdot 10^{-113}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 6600000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{B}, F, \frac{-x}{\tan B}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\ \end{array} \end{array} \]
          (FPCore (F B x)
           :precision binary64
           (if (<= F -7e+77)
             (- (/ -1.0 B) (/ x (tan B)))
             (if (<= F -4.4e-113)
               (- (/ F (* (sin B) (sqrt (fma F F 2.0)))) (/ x B))
               (if (<= F 6600000000.0)
                 (fma
                  (/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) B)
                  F
                  (/ (- x) (tan B)))
                 (+ (- (/ x B)) (pow (sin B) -1.0))))))
          double code(double F, double B, double x) {
          	double tmp;
          	if (F <= -7e+77) {
          		tmp = (-1.0 / B) - (x / tan(B));
          	} else if (F <= -4.4e-113) {
          		tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - (x / B);
          	} else if (F <= 6600000000.0) {
          		tmp = fma((sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / B), F, (-x / tan(B)));
          	} else {
          		tmp = -(x / B) + pow(sin(B), -1.0);
          	}
          	return tmp;
          }
          
          function code(F, B, x)
          	tmp = 0.0
          	if (F <= -7e+77)
          		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
          	elseif (F <= -4.4e-113)
          		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - Float64(x / B));
          	elseif (F <= 6600000000.0)
          		tmp = fma(Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / B), F, Float64(Float64(-x) / tan(B)));
          	else
          		tmp = Float64(Float64(-Float64(x / B)) + (sin(B) ^ -1.0));
          	end
          	return tmp
          end
          
          code[F_, B_, x_] := If[LessEqual[F, -7e+77], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.4e-113], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6600000000.0], N[(N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;F \leq -7 \cdot 10^{+77}:\\
          \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
          
          \mathbf{elif}\;F \leq -4.4 \cdot 10^{-113}:\\
          \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{B}\\
          
          \mathbf{elif}\;F \leq 6600000000:\\
          \;\;\;\;\mathsf{fma}\left(\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{B}, F, \frac{-x}{\tan B}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if F < -7.0000000000000003e77

            1. Initial program 59.3%

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

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

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              4. *-commutativeN/A

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
            4. Applied rewrites67.2%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
            5. Step-by-step derivation
              1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
            8. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
              2. lower-sin.f6499.7

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

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

              \[\leadsto \frac{-1}{\color{blue}{B}} - \frac{x}{\tan B} \]
            11. Step-by-step derivation
              1. Applied rewrites81.2%

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

              if -7.0000000000000003e77 < F < -4.40000000000000008e-113

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                4. *-commutativeN/A

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
              4. Applied rewrites99.3%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
              5. Step-by-step derivation
                1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
                4. lower-fma.f6499.2

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

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

                \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \color{blue}{\frac{x}{B}} \]
              11. Step-by-step derivation
                1. lower-/.f6479.6

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

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

              if -4.40000000000000008e-113 < F < 6.6e9

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                4. *-commutativeN/A

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
              4. Applied rewrites99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 6.6e9 < F

              1. Initial program 54.8%

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

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

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

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

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

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
              7. Step-by-step derivation
                1. lower-/.f6484.9

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
              8. Applied rewrites84.9%

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

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

            Alternative 9: 84.6% accurate, 1.4× speedup?

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

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                4. *-commutativeN/A

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
              4. Applied rewrites72.1%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
              5. Step-by-step derivation
                1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
              8. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                2. lower-sin.f6499.7

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

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

              if -4.1000000000000003e38 < F < 6.6e9

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                4. *-commutativeN/A

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
              4. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 6.6e9 < F

              1. Initial program 54.8%

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

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

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

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

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

                \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
              7. Step-by-step derivation
                1. lower-/.f6484.9

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
              8. Applied rewrites84.9%

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

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

            Alternative 10: 77.5% accurate, 1.5× speedup?

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

              1. Initial program 86.7%

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

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

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

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

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

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

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

                if -1.50000000000000004e-5 < x < 2.9499999999999999e-5

                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. Step-by-step derivation
                  1. lift-+.f64N/A

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

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  4. *-commutativeN/A

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                4. Applied rewrites72.1%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                5. Step-by-step derivation
                  1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
                  4. lower-fma.f6471.9

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

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

                  \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \color{blue}{\frac{x}{B}} \]
                11. Step-by-step derivation
                  1. lower-/.f6461.4

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

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

                if 2.9499999999999999e-5 < x

                1. Initial program 88.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  4. *-commutativeN/A

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                4. Applied rewrites99.7%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                5. Step-by-step derivation
                  1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                8. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                  2. lower-sin.f6497.4

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

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

                  \[\leadsto \frac{-1}{\color{blue}{B}} - \frac{x}{\tan B} \]
                11. Step-by-step derivation
                  1. Applied rewrites99.3%

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

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

                Alternative 11: 78.8% accurate, 1.6× speedup?

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

                  1. Initial program 59.3%

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

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

                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                    4. *-commutativeN/A

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                  4. Applied rewrites67.2%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                  5. Step-by-step derivation
                    1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                  8. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                    2. lower-sin.f6499.7

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

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

                    \[\leadsto \frac{-1}{\color{blue}{B}} - \frac{x}{\tan B} \]
                  11. Step-by-step derivation
                    1. Applied rewrites81.2%

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

                    if -7.0000000000000003e77 < F < -4.40000000000000008e-113

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

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                      4. *-commutativeN/A

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                    4. Applied rewrites99.3%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
                      4. lower-fma.f6499.2

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

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

                      \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \color{blue}{\frac{x}{B}} \]
                    11. Step-by-step derivation
                      1. lower-/.f6479.6

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

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

                    if -4.40000000000000008e-113 < F < 6.6e9

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

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                      4. *-commutativeN/A

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                    4. Applied rewrites99.7%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
                      4. lower-fma.f6499.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 6.6e9 < F

                    1. Initial program 54.8%

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

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

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

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

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

                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                    7. Step-by-step derivation
                      1. lower-/.f6484.9

                        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                    8. Applied rewrites84.9%

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

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

                  Alternative 12: 63.1% accurate, 1.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 6400000000:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F 6400000000.0)
                     (- (/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x (tan B)))
                     (+ (- (/ x B)) (pow (sin B) -1.0))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= 6400000000.0) {
                  		tmp = (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / tan(B));
                  	} else {
                  		tmp = -(x / B) + pow(sin(B), -1.0);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= 6400000000.0)
                  		tmp = Float64(Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / tan(B)));
                  	else
                  		tmp = Float64(Float64(-Float64(x / B)) + (sin(B) ^ -1.0));
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, 6400000000.0], N[(N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq 6400000000:\\
                  \;\;\;\;\frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if F < 6.4e9

                    1. Initial program 86.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. Step-by-step derivation
                      1. lift-+.f64N/A

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

                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                      4. *-commutativeN/A

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                    4. Applied rewrites89.6%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                      2. lower-sin.f6460.8

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

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

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

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

                      if 6.4e9 < F

                      1. Initial program 54.8%

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

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

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

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

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

                        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                      7. Step-by-step derivation
                        1. lower-/.f6484.9

                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                      8. Applied rewrites84.9%

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

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

                    Alternative 13: 61.7% accurate, 1.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 6400000000:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F 6400000000.0)
                       (- (/ -1.0 B) (/ x (tan B)))
                       (+ (- (/ x B)) (pow (sin B) -1.0))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= 6400000000.0) {
                    		tmp = (-1.0 / B) - (x / tan(B));
                    	} else {
                    		tmp = -(x / B) + pow(sin(B), -1.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) :: tmp
                        if (f <= 6400000000.0d0) then
                            tmp = ((-1.0d0) / b) - (x / tan(b))
                        else
                            tmp = -(x / b) + (sin(b) ** (-1.0d0))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= 6400000000.0) {
                    		tmp = (-1.0 / B) - (x / Math.tan(B));
                    	} else {
                    		tmp = -(x / B) + Math.pow(Math.sin(B), -1.0);
                    	}
                    	return tmp;
                    }
                    
                    def code(F, B, x):
                    	tmp = 0
                    	if F <= 6400000000.0:
                    		tmp = (-1.0 / B) - (x / math.tan(B))
                    	else:
                    		tmp = -(x / B) + math.pow(math.sin(B), -1.0)
                    	return tmp
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= 6400000000.0)
                    		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
                    	else
                    		tmp = Float64(Float64(-Float64(x / B)) + (sin(B) ^ -1.0));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(F, B, x)
                    	tmp = 0.0;
                    	if (F <= 6400000000.0)
                    		tmp = (-1.0 / B) - (x / tan(B));
                    	else
                    		tmp = -(x / B) + (sin(B) ^ -1.0);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, 6400000000.0], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq 6400000000:\\
                    \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if F < 6.4e9

                      1. Initial program 86.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. Step-by-step derivation
                        1. lift-+.f64N/A

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

                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                        4. *-commutativeN/A

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                      4. Applied rewrites89.6%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                      5. Step-by-step derivation
                        1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                      8. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                        2. lower-sin.f6460.8

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

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

                        \[\leadsto \frac{-1}{\color{blue}{B}} - \frac{x}{\tan B} \]
                      11. Step-by-step derivation
                        1. Applied rewrites59.1%

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

                        if 6.4e9 < F

                        1. Initial program 54.8%

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

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

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

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

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

                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                        7. Step-by-step derivation
                          1. lower-/.f6484.9

                            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                        8. Applied rewrites84.9%

                          \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{1}{\sin B} \]
                      12. Recombined 2 regimes into one program.
                      13. Final simplification66.5%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 6400000000:\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + {\sin B}^{-1}\\ \end{array} \]
                      14. Add Preprocessing

                      Alternative 14: 56.1% accurate, 2.0× speedup?

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

                        1. Initial program 77.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. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\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}} \]
                        5. Applied rewrites53.6%

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

                        if 7.79999999999999986e-4 < B

                        1. Initial program 78.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                          2. +-commutativeN/A

                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                          4. *-commutativeN/A

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                        4. Applied rewrites78.5%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                        5. Step-by-step derivation
                          1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                        8. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                          2. lower-sin.f6451.2

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

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

                          \[\leadsto \frac{-1}{\color{blue}{B}} - \frac{x}{\tan B} \]
                        11. Step-by-step derivation
                          1. Applied rewrites50.4%

                            \[\leadsto \frac{-1}{\color{blue}{B}} - \frac{x}{\tan B} \]
                        12. Recombined 2 regimes into one program.
                        13. Final simplification52.8%

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

                        Alternative 15: 77.5% accurate, 2.3× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-5} \lor \neg \left(x \leq 2.95 \cdot 10^{-5}\right):\\ \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{B}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (or (<= x -1e-5) (not (<= x 2.95e-5)))
                           (- (/ -1.0 B) (/ x (tan B)))
                           (- (/ F (* (sin B) (sqrt (fma F F 2.0)))) (/ x B))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if ((x <= -1e-5) || !(x <= 2.95e-5)) {
                        		tmp = (-1.0 / B) - (x / tan(B));
                        	} else {
                        		tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - (x / B);
                        	}
                        	return tmp;
                        }
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if ((x <= -1e-5) || !(x <= 2.95e-5))
                        		tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B)));
                        	else
                        		tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - Float64(x / B));
                        	end
                        	return tmp
                        end
                        
                        code[F_, B_, x_] := If[Or[LessEqual[x, -1e-5], N[Not[LessEqual[x, 2.95e-5]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -1 \cdot 10^{-5} \lor \neg \left(x \leq 2.95 \cdot 10^{-5}\right):\\
                        \;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{B}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -1.00000000000000008e-5 or 2.9499999999999999e-5 < x

                          1. Initial program 87.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                            2. +-commutativeN/A

                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                            4. *-commutativeN/A

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

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

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

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

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

                              \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                          4. Applied rewrites99.7%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                          5. Step-by-step derivation
                            1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                          8. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} - \frac{x}{\tan B} \]
                            2. lower-sin.f6496.1

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

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

                            \[\leadsto \frac{-1}{\color{blue}{B}} - \frac{x}{\tan B} \]
                          11. Step-by-step derivation
                            1. Applied rewrites99.3%

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

                            if -1.00000000000000008e-5 < x < 2.9499999999999999e-5

                            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. Step-by-step derivation
                              1. lift-+.f64N/A

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

                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                              4. *-commutativeN/A

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

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

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

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

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

                                \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                            4. Applied rewrites72.1%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                            5. Step-by-step derivation
                              1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{F}{\sin B \cdot \sqrt{\color{blue}{F \cdot F} + 2}} - \frac{x}{\tan B} \]
                              4. lower-fma.f6471.9

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

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

                              \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \color{blue}{\frac{x}{B}} \]
                            11. Step-by-step derivation
                              1. lower-/.f6461.4

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

                              \[\leadsto \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \color{blue}{\frac{x}{B}} \]
                          12. Recombined 2 regimes into one program.
                          13. Final simplification76.5%

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

                          Alternative 16: 51.2% accurate, 2.5× speedup?

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

                            1. Initial program 66.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto -1 \cdot \frac{1 + x}{B} + \color{blue}{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{B \cdot {F}^{2}}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites54.8%

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

                              if -8.80000000000000031e-4 < F < 1.69999999999999996

                              1. Initial program 99.3%

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

                                \[\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + 2 \cdot x}}, F, -x\right)}{B} \]
                              7. Step-by-step derivation
                                1. Applied rewrites46.9%

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

                                if 1.69999999999999996 < F

                                1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                  2. +-commutativeN/A

                                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                  4. *-commutativeN/A

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

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                4. Applied rewrites67.4%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                5. Step-by-step derivation
                                  1. lift-fma.f64N/A

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

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

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

                                    \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                  5. lift-/.f64N/A

                                    \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                  6. distribute-lft-neg-inN/A

                                    \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                  7. lift-*.f64N/A

                                    \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                  8. unsub-negN/A

                                    \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                  9. lower--.f64N/A

                                    \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                6. Applied rewrites67.4%

                                  \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                7. 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}} \]
                                8. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\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}} \]
                                9. Applied rewrites35.5%

                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                10. Taylor expanded in F around inf

                                  \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                11. Step-by-step derivation
                                  1. Applied rewrites47.5%

                                    \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                12. Recombined 3 regimes into one program.
                                13. Final simplification49.3%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00088:\\ \;\;\;\;\mathsf{fma}\left(\frac{0.5}{B}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, \frac{-1 - x}{B}\right)\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                14. Add Preprocessing

                                Alternative 17: 51.2% accurate, 2.5× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.00088:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= F -0.00088)
                                   (/ (fma (/ 0.5 F) (/ (fma 2.0 x 2.0) F) (- -1.0 x)) B)
                                   (if (<= F 1.7)
                                     (/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
                                     (/
                                      (- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
                                      B))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -0.00088) {
                                		tmp = fma((0.5 / F), (fma(2.0, x, 2.0) / F), (-1.0 - x)) / B;
                                	} else if (F <= 1.7) {
                                		tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
                                	} else {
                                		tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= -0.00088)
                                		tmp = Float64(fma(Float64(0.5 / F), Float64(fma(2.0, x, 2.0) / F), Float64(-1.0 - x)) / B);
                                	elseif (F <= 1.7)
                                		tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B);
                                	else
                                		tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B);
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, -0.00088], N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7], N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;F \leq -0.00088:\\
                                \;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, -1 - x\right)}{B}\\
                                
                                \mathbf{elif}\;F \leq 1.7:\\
                                \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if F < -8.80000000000000031e-4

                                  1. Initial program 66.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. *-commutativeN/A

                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                    4. lower-fma.f64N/A

                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                    5. lower-sqrt.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    6. lower-/.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    7. associate-+r+N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    8. +-commutativeN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    9. unpow2N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    10. lower-fma.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    11. +-commutativeN/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    12. lower-fma.f64N/A

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                    13. lower-neg.f6439.4

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                  5. Applied rewrites39.4%

                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                  6. Taylor expanded in F around -inf

                                    \[\leadsto \frac{\frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}} - \left(1 + x\right)}{B} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites54.7%

                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, -1 - x\right)}{B} \]

                                    if -8.80000000000000031e-4 < F < 1.69999999999999996

                                    1. Initial program 99.3%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in B around 0

                                      \[\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. *-commutativeN/A

                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                      4. lower-fma.f64N/A

                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                      5. lower-sqrt.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      6. lower-/.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      7. associate-+r+N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      8. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      9. unpow2N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      10. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      11. +-commutativeN/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      12. lower-fma.f64N/A

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                      13. lower-neg.f6446.9

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                    5. Applied rewrites46.9%

                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                    6. Taylor expanded in F around 0

                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + 2 \cdot x}}, F, -x\right)}{B} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites46.9%

                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, F, -x\right)}{B} \]

                                      if 1.69999999999999996 < F

                                      1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                        2. +-commutativeN/A

                                          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                        4. *-commutativeN/A

                                          \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                        5. lift-/.f64N/A

                                          \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                        6. clear-numN/A

                                          \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                        7. associate-/r/N/A

                                          \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                        8. associate-*r*N/A

                                          \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                        9. div-invN/A

                                          \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                      4. Applied rewrites67.4%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                      5. Step-by-step derivation
                                        1. lift-fma.f64N/A

                                          \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                        2. lift-/.f64N/A

                                          \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                        3. div-invN/A

                                          \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                        4. lift-neg.f64N/A

                                          \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                        5. lift-/.f64N/A

                                          \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                        6. distribute-lft-neg-inN/A

                                          \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                        7. lift-*.f64N/A

                                          \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                        8. unsub-negN/A

                                          \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                        9. lower--.f64N/A

                                          \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                      6. Applied rewrites67.4%

                                        \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                      7. 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}} \]
                                      8. Step-by-step derivation
                                        1. lower-/.f64N/A

                                          \[\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}} \]
                                      9. Applied rewrites35.5%

                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                      10. Taylor expanded in F around inf

                                        \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                      11. Step-by-step derivation
                                        1. Applied rewrites47.5%

                                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                      12. Recombined 3 regimes into one program.
                                      13. Final simplification49.2%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00088:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                      14. Add Preprocessing

                                      Alternative 18: 51.3% accurate, 2.5× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.36 \cdot 10^{+158}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 3000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                      (FPCore (F B x)
                                       :precision binary64
                                       (if (<= F -1.36e+158)
                                         (/
                                          (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
                                          B)
                                         (if (<= F 3000000000.0)
                                           (/ (fma (sqrt (pow (fma F F 2.0) -1.0)) F (- x)) B)
                                           (/
                                            (- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
                                            B))))
                                      double code(double F, double B, double x) {
                                      	double tmp;
                                      	if (F <= -1.36e+158) {
                                      		tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
                                      	} else if (F <= 3000000000.0) {
                                      		tmp = fma(sqrt(pow(fma(F, F, 2.0), -1.0)), F, -x) / B;
                                      	} else {
                                      		tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(F, B, x)
                                      	tmp = 0.0
                                      	if (F <= -1.36e+158)
                                      		tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B);
                                      	elseif (F <= 3000000000.0)
                                      		tmp = Float64(fma(sqrt((fma(F, F, 2.0) ^ -1.0)), F, Float64(-x)) / B);
                                      	else
                                      		tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B);
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[F_, B_, x_] := If[LessEqual[F, -1.36e+158], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3000000000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;F \leq -1.36 \cdot 10^{+158}:\\
                                      \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
                                      
                                      \mathbf{elif}\;F \leq 3000000000:\\
                                      \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if F < -1.35999999999999992e158

                                        1. Initial program 41.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                          2. +-commutativeN/A

                                            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                          4. *-commutativeN/A

                                            \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                          5. lift-/.f64N/A

                                            \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                          6. clear-numN/A

                                            \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                          7. associate-/r/N/A

                                            \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                          8. associate-*r*N/A

                                            \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                          9. div-invN/A

                                            \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                        4. Applied rewrites53.0%

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                        5. Step-by-step derivation
                                          1. lift-fma.f64N/A

                                            \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                          2. lift-/.f64N/A

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                          3. div-invN/A

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                          4. lift-neg.f64N/A

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                          5. lift-/.f64N/A

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                          6. distribute-lft-neg-inN/A

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                          7. lift-*.f64N/A

                                            \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                          8. unsub-negN/A

                                            \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                          9. lower--.f64N/A

                                            \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                        6. Applied rewrites53.0%

                                          \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                        7. 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}} \]
                                        8. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\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}} \]
                                        9. Applied rewrites24.9%

                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                        10. Taylor expanded in F around -inf

                                          \[\leadsto \frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)}{B} \]
                                        11. Step-by-step derivation
                                          1. Applied rewrites52.4%

                                            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B} \]

                                          if -1.35999999999999992e158 < F < 3e9

                                          1. Initial program 98.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. *-commutativeN/A

                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                            4. lower-fma.f64N/A

                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                            5. lower-sqrt.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            6. lower-/.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            7. associate-+r+N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            8. +-commutativeN/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            9. unpow2N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            10. lower-fma.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            11. +-commutativeN/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            12. lower-fma.f64N/A

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                            13. lower-neg.f6449.3

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                          5. Applied rewrites49.3%

                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                          6. Taylor expanded in x around 0

                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}}, F, -x\right)}{B} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites49.3%

                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B} \]

                                            if 3e9 < F

                                            1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                              2. +-commutativeN/A

                                                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                              4. *-commutativeN/A

                                                \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                              5. lift-/.f64N/A

                                                \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                              6. clear-numN/A

                                                \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                              7. associate-/r/N/A

                                                \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                              8. associate-*r*N/A

                                                \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                              9. div-invN/A

                                                \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                            4. Applied rewrites67.4%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                            5. Step-by-step derivation
                                              1. lift-fma.f64N/A

                                                \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                              2. lift-/.f64N/A

                                                \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                              3. div-invN/A

                                                \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                              4. lift-neg.f64N/A

                                                \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                              5. lift-/.f64N/A

                                                \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                              6. distribute-lft-neg-inN/A

                                                \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                              7. lift-*.f64N/A

                                                \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                              8. unsub-negN/A

                                                \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                              9. lower--.f64N/A

                                                \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                            6. Applied rewrites67.4%

                                              \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                            7. 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}} \]
                                            8. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\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}} \]
                                            9. Applied rewrites35.5%

                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                            10. Taylor expanded in F around inf

                                              \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                            11. Step-by-step derivation
                                              1. Applied rewrites47.5%

                                                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                            12. Recombined 3 regimes into one program.
                                            13. Final simplification49.2%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -1.36 \cdot 10^{+158}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 3000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                            14. Add Preprocessing

                                            Alternative 19: 51.1% accurate, 2.5× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.00088:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -0.00088)
                                               (/
                                                (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
                                                B)
                                               (if (<= F 1.7)
                                                 (/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
                                                 (/
                                                  (- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
                                                  B))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -0.00088) {
                                            		tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
                                            	} else if (F <= 1.7) {
                                            		tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
                                            	} else {
                                            		tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -0.00088)
                                            		tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B);
                                            	elseif (F <= 1.7)
                                            		tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B);
                                            	else
                                            		tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B);
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -0.00088], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7], N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -0.00088:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
                                            
                                            \mathbf{elif}\;F \leq 1.7:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -8.80000000000000031e-4

                                              1. Initial program 66.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. Step-by-step derivation
                                                1. lift-+.f64N/A

                                                  \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                                2. +-commutativeN/A

                                                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                4. *-commutativeN/A

                                                  \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                5. lift-/.f64N/A

                                                  \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                6. clear-numN/A

                                                  \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                7. associate-/r/N/A

                                                  \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                8. associate-*r*N/A

                                                  \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                9. div-invN/A

                                                  \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                              4. Applied rewrites74.0%

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                              5. Step-by-step derivation
                                                1. lift-fma.f64N/A

                                                  \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                                2. lift-/.f64N/A

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                                3. div-invN/A

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                                4. lift-neg.f64N/A

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                                5. lift-/.f64N/A

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                                6. distribute-lft-neg-inN/A

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                7. lift-*.f64N/A

                                                  \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                                8. unsub-negN/A

                                                  \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                9. lower--.f64N/A

                                                  \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                              6. Applied rewrites73.9%

                                                \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                              7. 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}} \]
                                              8. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\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}} \]
                                              9. Applied rewrites39.6%

                                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                              10. Taylor expanded in F around -inf

                                                \[\leadsto \frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)}{B} \]
                                              11. Step-by-step derivation
                                                1. Applied rewrites54.3%

                                                  \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B} \]

                                                if -8.80000000000000031e-4 < F < 1.69999999999999996

                                                1. Initial program 99.3%

                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in B around 0

                                                  \[\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. *-commutativeN/A

                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                  4. lower-fma.f64N/A

                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                  5. lower-sqrt.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  7. associate-+r+N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  8. +-commutativeN/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  9. unpow2N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  10. lower-fma.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  11. +-commutativeN/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  12. lower-fma.f64N/A

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                  13. lower-neg.f6446.9

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                5. Applied rewrites46.9%

                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                6. Taylor expanded in F around 0

                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + 2 \cdot x}}, F, -x\right)}{B} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites46.9%

                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, F, -x\right)}{B} \]

                                                  if 1.69999999999999996 < F

                                                  1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                                    2. +-commutativeN/A

                                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                    4. *-commutativeN/A

                                                      \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                    5. lift-/.f64N/A

                                                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                    6. clear-numN/A

                                                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                    7. associate-/r/N/A

                                                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                    8. associate-*r*N/A

                                                      \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                    9. div-invN/A

                                                      \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                                  4. Applied rewrites67.4%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                                  5. Step-by-step derivation
                                                    1. lift-fma.f64N/A

                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                                    2. lift-/.f64N/A

                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                                    3. div-invN/A

                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                                    4. lift-neg.f64N/A

                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                                    5. lift-/.f64N/A

                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                                    6. distribute-lft-neg-inN/A

                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                    7. lift-*.f64N/A

                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                                    8. unsub-negN/A

                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                    9. lower--.f64N/A

                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                  6. Applied rewrites67.4%

                                                    \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                                  7. 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}} \]
                                                  8. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\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}} \]
                                                  9. Applied rewrites35.5%

                                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                                  10. Taylor expanded in F around inf

                                                    \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                                  11. Step-by-step derivation
                                                    1. Applied rewrites47.5%

                                                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                                  12. Recombined 3 regimes into one program.
                                                  13. Final simplification49.1%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -0.00088:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \]
                                                  14. Add Preprocessing

                                                  Alternative 20: 51.1% accurate, 8.4× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.00088:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                                  (FPCore (F B x)
                                                   :precision binary64
                                                   (if (<= F -0.00088)
                                                     (/
                                                      (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
                                                      B)
                                                     (if (<= F 1.7)
                                                       (/ (fma (sqrt 0.5) F (- x)) B)
                                                       (/
                                                        (- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
                                                        B))))
                                                  double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (F <= -0.00088) {
                                                  		tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
                                                  	} else if (F <= 1.7) {
                                                  		tmp = fma(sqrt(0.5), F, -x) / B;
                                                  	} else {
                                                  		tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(F, B, x)
                                                  	tmp = 0.0
                                                  	if (F <= -0.00088)
                                                  		tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B);
                                                  	elseif (F <= 1.7)
                                                  		tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B);
                                                  	else
                                                  		tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[F_, B_, x_] := If[LessEqual[F, -0.00088], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;F \leq -0.00088:\\
                                                  \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
                                                  
                                                  \mathbf{elif}\;F \leq 1.7:\\
                                                  \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if F < -8.80000000000000031e-4

                                                    1. Initial program 66.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. Step-by-step derivation
                                                      1. lift-+.f64N/A

                                                        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                                      2. +-commutativeN/A

                                                        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      4. *-commutativeN/A

                                                        \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      5. lift-/.f64N/A

                                                        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      6. clear-numN/A

                                                        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      7. associate-/r/N/A

                                                        \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      8. associate-*r*N/A

                                                        \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                      9. div-invN/A

                                                        \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                                    4. Applied rewrites74.0%

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                                    5. Step-by-step derivation
                                                      1. lift-fma.f64N/A

                                                        \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                                      2. lift-/.f64N/A

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                                      3. div-invN/A

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                                      4. lift-neg.f64N/A

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                                      5. lift-/.f64N/A

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                                      6. distribute-lft-neg-inN/A

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                      7. lift-*.f64N/A

                                                        \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                                      8. unsub-negN/A

                                                        \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                      9. lower--.f64N/A

                                                        \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                    6. Applied rewrites73.9%

                                                      \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                                    7. 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}} \]
                                                    8. Step-by-step derivation
                                                      1. lower-/.f64N/A

                                                        \[\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}} \]
                                                    9. Applied rewrites39.6%

                                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                                    10. Taylor expanded in F around -inf

                                                      \[\leadsto \frac{{B}^{2} \cdot \left(\frac{1}{3} \cdot x - \frac{1}{6}\right) - \left(1 + x\right)}{B} \]
                                                    11. Step-by-step derivation
                                                      1. Applied rewrites54.3%

                                                        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B} \]

                                                      if -8.80000000000000031e-4 < F < 1.69999999999999996

                                                      1. Initial program 99.3%

                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in B around 0

                                                        \[\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. *-commutativeN/A

                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                        4. lower-fma.f64N/A

                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                        5. lower-sqrt.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        6. lower-/.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        7. associate-+r+N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        8. +-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        9. unpow2N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        10. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        11. +-commutativeN/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        12. lower-fma.f64N/A

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                        13. lower-neg.f6446.9

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                      5. Applied rewrites46.9%

                                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                      6. Taylor expanded in x around 0

                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}}, F, -x\right)}{B} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites46.9%

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B} \]
                                                        2. Taylor expanded in F around 0

                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2}}, F, -x\right)}{B} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites46.9%

                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B} \]

                                                          if 1.69999999999999996 < F

                                                          1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                                            2. +-commutativeN/A

                                                              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                            4. *-commutativeN/A

                                                              \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                            5. lift-/.f64N/A

                                                              \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                            6. clear-numN/A

                                                              \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                            7. associate-/r/N/A

                                                              \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                            8. associate-*r*N/A

                                                              \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                            9. div-invN/A

                                                              \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                                          4. Applied rewrites67.4%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                                          5. Step-by-step derivation
                                                            1. lift-fma.f64N/A

                                                              \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                                            2. lift-/.f64N/A

                                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                                            3. div-invN/A

                                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                                            4. lift-neg.f64N/A

                                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                                            5. lift-/.f64N/A

                                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                                            6. distribute-lft-neg-inN/A

                                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                            7. lift-*.f64N/A

                                                              \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                                            8. unsub-negN/A

                                                              \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                            9. lower--.f64N/A

                                                              \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                          6. Applied rewrites67.4%

                                                            \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                                          7. 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}} \]
                                                          8. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\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}} \]
                                                          9. Applied rewrites35.5%

                                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                                          10. Taylor expanded in F around inf

                                                            \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                                          11. Step-by-step derivation
                                                            1. Applied rewrites47.5%

                                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                                          12. Recombined 3 regimes into one program.
                                                          13. Add Preprocessing

                                                          Alternative 21: 51.1% accurate, 8.4× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.7:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
                                                          (FPCore (F B x)
                                                           :precision binary64
                                                           (if (<= F -1.4)
                                                             (/ (- -1.0 x) B)
                                                             (if (<= F 1.7)
                                                               (/ (fma (sqrt 0.5) F (- x)) B)
                                                               (/
                                                                (- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
                                                                B))))
                                                          double code(double F, double B, double x) {
                                                          	double tmp;
                                                          	if (F <= -1.4) {
                                                          		tmp = (-1.0 - x) / B;
                                                          	} else if (F <= 1.7) {
                                                          		tmp = fma(sqrt(0.5), F, -x) / B;
                                                          	} else {
                                                          		tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          function code(F, B, x)
                                                          	tmp = 0.0
                                                          	if (F <= -1.4)
                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                          	elseif (F <= 1.7)
                                                          		tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B);
                                                          	else
                                                          		tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          \mathbf{if}\;F \leq -1.4:\\
                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                          
                                                          \mathbf{elif}\;F \leq 1.7:\\
                                                          \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 3 regimes
                                                          2. if F < -1.3999999999999999

                                                            1. Initial program 66.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. *-commutativeN/A

                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                              4. lower-fma.f64N/A

                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                              5. lower-sqrt.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              6. lower-/.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              7. associate-+r+N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              8. +-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              9. unpow2N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              10. lower-fma.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              11. +-commutativeN/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              12. lower-fma.f64N/A

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                              13. lower-neg.f6439.9

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                            5. Applied rewrites39.9%

                                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -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 rewrites55.0%

                                                                \[\leadsto \frac{-1 - x}{B} \]

                                                              if -1.3999999999999999 < F < 1.69999999999999996

                                                              1. Initial program 99.3%

                                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in B around 0

                                                                \[\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. *-commutativeN/A

                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                4. lower-fma.f64N/A

                                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                5. lower-sqrt.f64N/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                6. lower-/.f64N/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                7. associate-+r+N/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                8. +-commutativeN/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                9. unpow2N/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                10. lower-fma.f64N/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                11. +-commutativeN/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                12. lower-fma.f64N/A

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                13. lower-neg.f6446.5

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                              5. Applied rewrites46.5%

                                                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                              6. Taylor expanded in x around 0

                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}}, F, -x\right)}{B} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites46.5%

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B} \]
                                                                2. Taylor expanded in F around 0

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2}}, F, -x\right)}{B} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites46.5%

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B} \]

                                                                  if 1.69999999999999996 < F

                                                                  1. Initial program 55.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(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                                                    2. +-commutativeN/A

                                                                      \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    4. *-commutativeN/A

                                                                      \[\leadsto \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    5. lift-/.f64N/A

                                                                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{F}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    6. clear-numN/A

                                                                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\frac{1}{\frac{\sin B}{F}}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    7. associate-/r/N/A

                                                                      \[\leadsto {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    8. associate-*r*N/A

                                                                      \[\leadsto \color{blue}{\left({\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{1}{\sin B}\right) \cdot F} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                                                                    9. div-invN/A

                                                                      \[\leadsto \color{blue}{\frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} \cdot F + \left(-x \cdot \frac{1}{\tan B}\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(-\frac{1}{2}\right)}}{\sin B}, F, -x \cdot \frac{1}{\tan B}\right)} \]
                                                                  4. Applied rewrites67.4%

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)} \]
                                                                  5. Step-by-step derivation
                                                                    1. lift-fma.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \frac{-x}{\tan B}} \]
                                                                    2. lift-/.f64N/A

                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\frac{-x}{\tan B}} \]
                                                                    3. div-invN/A

                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(-x\right) \cdot \frac{1}{\tan B}} \]
                                                                    4. lift-neg.f64N/A

                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
                                                                    5. lift-/.f64N/A

                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
                                                                    6. distribute-lft-neg-inN/A

                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
                                                                    7. lift-*.f64N/A

                                                                      \[\leadsto \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                                                                    8. unsub-negN/A

                                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                                    9. lower--.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} \cdot F - x \cdot \frac{1}{\tan B}} \]
                                                                  6. Applied rewrites67.4%

                                                                    \[\leadsto \color{blue}{\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}} \]
                                                                  7. 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}} \]
                                                                  8. Step-by-step derivation
                                                                    1. lower-/.f64N/A

                                                                      \[\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}} \]
                                                                  9. Applied rewrites35.5%

                                                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)}}, F, -x\right)\right)}{B}} \]
                                                                  10. Taylor expanded in F around inf

                                                                    \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{6} + \frac{1}{3} \cdot x\right)\right) - x}{B} \]
                                                                  11. Step-by-step derivation
                                                                    1. Applied rewrites47.5%

                                                                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B} \]
                                                                  12. Recombined 3 regimes into one program.
                                                                  13. Add Preprocessing

                                                                  Alternative 22: 50.9% accurate, 8.8× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8.2 \cdot 10^{-16}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                  (FPCore (F B x)
                                                                   :precision binary64
                                                                   (if (<= F -1.4)
                                                                     (/ (- -1.0 x) B)
                                                                     (if (<= F 8.2e-16) (/ (fma (sqrt 0.5) F (- x)) B) (/ (- 1.0 x) B))))
                                                                  double code(double F, double B, double x) {
                                                                  	double tmp;
                                                                  	if (F <= -1.4) {
                                                                  		tmp = (-1.0 - x) / B;
                                                                  	} else if (F <= 8.2e-16) {
                                                                  		tmp = fma(sqrt(0.5), F, -x) / B;
                                                                  	} else {
                                                                  		tmp = (1.0 - x) / B;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  function code(F, B, x)
                                                                  	tmp = 0.0
                                                                  	if (F <= -1.4)
                                                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                                                  	elseif (F <= 8.2e-16)
                                                                  		tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B);
                                                                  	else
                                                                  		tmp = Float64(Float64(1.0 - x) / B);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.2e-16], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;F \leq -1.4:\\
                                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                                  
                                                                  \mathbf{elif}\;F \leq 8.2 \cdot 10^{-16}:\\
                                                                  \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{1 - x}{B}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if F < -1.3999999999999999

                                                                    1. Initial program 66.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. *-commutativeN/A

                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      4. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                      5. lower-sqrt.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      6. lower-/.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      7. associate-+r+N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      8. +-commutativeN/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      9. unpow2N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      10. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      11. +-commutativeN/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      12. lower-fma.f64N/A

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                      13. lower-neg.f6439.9

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                    5. Applied rewrites39.9%

                                                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -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 rewrites55.0%

                                                                        \[\leadsto \frac{-1 - x}{B} \]

                                                                      if -1.3999999999999999 < F < 8.20000000000000012e-16

                                                                      1. Initial program 99.3%

                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in B around 0

                                                                        \[\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. *-commutativeN/A

                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        4. lower-fma.f64N/A

                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                        5. lower-sqrt.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        6. lower-/.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        7. associate-+r+N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        8. +-commutativeN/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        9. unpow2N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        10. lower-fma.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        11. +-commutativeN/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        12. lower-fma.f64N/A

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                        13. lower-neg.f6447.8

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                      5. Applied rewrites47.8%

                                                                        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                      6. Taylor expanded in x around 0

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2 + {F}^{2}}}, F, -x\right)}{B} \]
                                                                      7. Step-by-step derivation
                                                                        1. Applied rewrites47.8%

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B} \]
                                                                        2. Taylor expanded in F around 0

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{2}}, F, -x\right)}{B} \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites47.8%

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B} \]

                                                                          if 8.20000000000000012e-16 < F

                                                                          1. Initial program 58.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. *-commutativeN/A

                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            4. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                            5. lower-sqrt.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            6. lower-/.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            7. associate-+r+N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            8. +-commutativeN/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            9. unpow2N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            10. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            11. +-commutativeN/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            12. lower-fma.f64N/A

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                            13. lower-neg.f6434.4

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                          5. Applied rewrites34.4%

                                                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                          6. Taylor expanded in F around inf

                                                                            \[\leadsto \frac{1 - x}{B} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites45.6%

                                                                              \[\leadsto \frac{1 - x}{B} \]
                                                                          8. Recombined 3 regimes into one program.
                                                                          9. Add Preprocessing

                                                                          Alternative 23: 44.3% accurate, 13.6× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.1 \cdot 10^{-73}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-19}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                                          (FPCore (F B x)
                                                                           :precision binary64
                                                                           (if (<= F -5.1e-73)
                                                                             (/ (- -1.0 x) B)
                                                                             (if (<= F 8e-19) (/ (- x) B) (/ (- 1.0 x) B))))
                                                                          double code(double F, double B, double x) {
                                                                          	double tmp;
                                                                          	if (F <= -5.1e-73) {
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	} else if (F <= 8e-19) {
                                                                          		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 <= (-5.1d-73)) then
                                                                                  tmp = ((-1.0d0) - x) / b
                                                                              else if (f <= 8d-19) 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 <= -5.1e-73) {
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	} else if (F <= 8e-19) {
                                                                          		tmp = -x / B;
                                                                          	} else {
                                                                          		tmp = (1.0 - x) / B;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          def code(F, B, x):
                                                                          	tmp = 0
                                                                          	if F <= -5.1e-73:
                                                                          		tmp = (-1.0 - x) / B
                                                                          	elif F <= 8e-19:
                                                                          		tmp = -x / B
                                                                          	else:
                                                                          		tmp = (1.0 - x) / B
                                                                          	return tmp
                                                                          
                                                                          function code(F, B, x)
                                                                          	tmp = 0.0
                                                                          	if (F <= -5.1e-73)
                                                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                                                          	elseif (F <= 8e-19)
                                                                          		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 <= -5.1e-73)
                                                                          		tmp = (-1.0 - x) / B;
                                                                          	elseif (F <= 8e-19)
                                                                          		tmp = -x / B;
                                                                          	else
                                                                          		tmp = (1.0 - x) / B;
                                                                          	end
                                                                          	tmp_2 = tmp;
                                                                          end
                                                                          
                                                                          code[F_, B_, x_] := If[LessEqual[F, -5.1e-73], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e-19], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;F \leq -5.1 \cdot 10^{-73}:\\
                                                                          \;\;\;\;\frac{-1 - x}{B}\\
                                                                          
                                                                          \mathbf{elif}\;F \leq 8 \cdot 10^{-19}:\\
                                                                          \;\;\;\;\frac{-x}{B}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\frac{1 - x}{B}\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 3 regimes
                                                                          2. if F < -5.1e-73

                                                                            1. Initial program 71.3%

                                                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in 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. *-commutativeN/A

                                                                                \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              4. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                              5. lower-sqrt.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              6. lower-/.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              7. associate-+r+N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              8. +-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              9. unpow2N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              10. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              11. +-commutativeN/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              12. lower-fma.f64N/A

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                              13. lower-neg.f6441.1

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                            5. Applied rewrites41.1%

                                                                              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -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 rewrites48.3%

                                                                                \[\leadsto \frac{-1 - x}{B} \]

                                                                              if -5.1e-73 < F < 7.9999999999999998e-19

                                                                              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. *-commutativeN/A

                                                                                  \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                4. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                5. lower-sqrt.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                6. lower-/.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                7. associate-+r+N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                8. +-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                9. unpow2N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                10. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                11. +-commutativeN/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                12. lower-fma.f64N/A

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                13. lower-neg.f6447.3

                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                              5. Applied rewrites47.3%

                                                                                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                              6. Taylor expanded in F around 0

                                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites38.8%

                                                                                  \[\leadsto \frac{-x}{B} \]

                                                                                if 7.9999999999999998e-19 < F

                                                                                1. Initial program 59.2%

                                                                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                2. Add Preprocessing
                                                                                3. Taylor expanded in B around 0

                                                                                  \[\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. *-commutativeN/A

                                                                                    \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  4. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                  5. lower-sqrt.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  6. lower-/.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  7. associate-+r+N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  8. +-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  9. unpow2N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  10. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  11. +-commutativeN/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  12. lower-fma.f64N/A

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                  13. lower-neg.f6435.2

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                5. Applied rewrites35.2%

                                                                                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                6. Taylor expanded in F around inf

                                                                                  \[\leadsto \frac{1 - x}{B} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites45.2%

                                                                                    \[\leadsto \frac{1 - x}{B} \]
                                                                                8. Recombined 3 regimes into one program.
                                                                                9. Add Preprocessing

                                                                                Alternative 24: 31.6% accurate, 14.1× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{-188} \lor \neg \left(x \leq 3.6 \cdot 10^{-182}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \end{array} \]
                                                                                (FPCore (F B x)
                                                                                 :precision binary64
                                                                                 (if (or (<= x -1.85e-188) (not (<= x 3.6e-182))) (/ (- x) B) (/ -1.0 B)))
                                                                                double code(double F, double B, double x) {
                                                                                	double tmp;
                                                                                	if ((x <= -1.85e-188) || !(x <= 3.6e-182)) {
                                                                                		tmp = -x / B;
                                                                                	} else {
                                                                                		tmp = -1.0 / B;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                real(8) function code(f, b, x)
                                                                                    real(8), intent (in) :: f
                                                                                    real(8), intent (in) :: b
                                                                                    real(8), intent (in) :: x
                                                                                    real(8) :: tmp
                                                                                    if ((x <= (-1.85d-188)) .or. (.not. (x <= 3.6d-182))) then
                                                                                        tmp = -x / b
                                                                                    else
                                                                                        tmp = (-1.0d0) / b
                                                                                    end if
                                                                                    code = tmp
                                                                                end function
                                                                                
                                                                                public static double code(double F, double B, double x) {
                                                                                	double tmp;
                                                                                	if ((x <= -1.85e-188) || !(x <= 3.6e-182)) {
                                                                                		tmp = -x / B;
                                                                                	} else {
                                                                                		tmp = -1.0 / B;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                def code(F, B, x):
                                                                                	tmp = 0
                                                                                	if (x <= -1.85e-188) or not (x <= 3.6e-182):
                                                                                		tmp = -x / B
                                                                                	else:
                                                                                		tmp = -1.0 / B
                                                                                	return tmp
                                                                                
                                                                                function code(F, B, x)
                                                                                	tmp = 0.0
                                                                                	if ((x <= -1.85e-188) || !(x <= 3.6e-182))
                                                                                		tmp = Float64(Float64(-x) / B);
                                                                                	else
                                                                                		tmp = Float64(-1.0 / B);
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                function tmp_2 = code(F, B, x)
                                                                                	tmp = 0.0;
                                                                                	if ((x <= -1.85e-188) || ~((x <= 3.6e-182)))
                                                                                		tmp = -x / B;
                                                                                	else
                                                                                		tmp = -1.0 / B;
                                                                                	end
                                                                                	tmp_2 = tmp;
                                                                                end
                                                                                
                                                                                code[F_, B_, x_] := If[Or[LessEqual[x, -1.85e-188], N[Not[LessEqual[x, 3.6e-182]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;x \leq -1.85 \cdot 10^{-188} \lor \neg \left(x \leq 3.6 \cdot 10^{-182}\right):\\
                                                                                \;\;\;\;\frac{-x}{B}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\frac{-1}{B}\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 2 regimes
                                                                                2. if x < -1.84999999999999986e-188 or 3.59999999999999977e-182 < x

                                                                                  1. Initial program 82.1%

                                                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                  2. Add Preprocessing
                                                                                  3. Taylor expanded in 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. *-commutativeN/A

                                                                                      \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    4. lower-fma.f64N/A

                                                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                    5. lower-sqrt.f64N/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    6. lower-/.f64N/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    7. associate-+r+N/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    8. +-commutativeN/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    9. unpow2N/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    10. lower-fma.f64N/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    11. +-commutativeN/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    12. lower-fma.f64N/A

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                    13. lower-neg.f6444.2

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                  5. Applied rewrites44.2%

                                                                                    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                  6. Taylor expanded in F around 0

                                                                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites35.2%

                                                                                      \[\leadsto \frac{-x}{B} \]

                                                                                    if -1.84999999999999986e-188 < x < 3.59999999999999977e-182

                                                                                    1. Initial program 63.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. *-commutativeN/A

                                                                                        \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      4. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                      5. lower-sqrt.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      6. lower-/.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      7. associate-+r+N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      8. +-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      9. unpow2N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      10. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      11. +-commutativeN/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      12. lower-fma.f64N/A

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                      13. lower-neg.f6433.3

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                    5. Applied rewrites33.3%

                                                                                      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -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 rewrites24.0%

                                                                                        \[\leadsto \frac{-1 - x}{B} \]
                                                                                      2. Taylor expanded in x around 0

                                                                                        \[\leadsto \frac{-1}{B} \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites24.0%

                                                                                          \[\leadsto \frac{-1}{B} \]
                                                                                      4. Recombined 2 regimes into one program.
                                                                                      5. Final simplification32.4%

                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{-188} \lor \neg \left(x \leq 3.6 \cdot 10^{-182}\right):\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B}\\ \end{array} \]
                                                                                      6. Add Preprocessing

                                                                                      Alternative 25: 37.3% accurate, 17.5× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.1 \cdot 10^{-73}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                                                      (FPCore (F B x)
                                                                                       :precision binary64
                                                                                       (if (<= F -5.1e-73) (/ (- -1.0 x) B) (/ (- x) B)))
                                                                                      double code(double F, double B, double x) {
                                                                                      	double tmp;
                                                                                      	if (F <= -5.1e-73) {
                                                                                      		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 <= (-5.1d-73)) 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 <= -5.1e-73) {
                                                                                      		tmp = (-1.0 - x) / B;
                                                                                      	} else {
                                                                                      		tmp = -x / B;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      def code(F, B, x):
                                                                                      	tmp = 0
                                                                                      	if F <= -5.1e-73:
                                                                                      		tmp = (-1.0 - x) / B
                                                                                      	else:
                                                                                      		tmp = -x / B
                                                                                      	return tmp
                                                                                      
                                                                                      function code(F, B, x)
                                                                                      	tmp = 0.0
                                                                                      	if (F <= -5.1e-73)
                                                                                      		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 <= -5.1e-73)
                                                                                      		tmp = (-1.0 - x) / B;
                                                                                      	else
                                                                                      		tmp = -x / B;
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      code[F_, B_, x_] := If[LessEqual[F, -5.1e-73], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;F \leq -5.1 \cdot 10^{-73}:\\
                                                                                      \;\;\;\;\frac{-1 - x}{B}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\frac{-x}{B}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if F < -5.1e-73

                                                                                        1. Initial program 71.3%

                                                                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in 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. *-commutativeN/A

                                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          4. lower-fma.f64N/A

                                                                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                          5. lower-sqrt.f64N/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          6. lower-/.f64N/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          7. associate-+r+N/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          8. +-commutativeN/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          9. unpow2N/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          10. lower-fma.f64N/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          11. +-commutativeN/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          12. lower-fma.f64N/A

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                          13. lower-neg.f6441.1

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                        5. Applied rewrites41.1%

                                                                                          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -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 rewrites48.3%

                                                                                            \[\leadsto \frac{-1 - x}{B} \]

                                                                                          if -5.1e-73 < F

                                                                                          1. Initial program 80.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. *-commutativeN/A

                                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            4. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                            5. lower-sqrt.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            6. lower-/.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            7. associate-+r+N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            8. +-commutativeN/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            9. unpow2N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            10. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            11. +-commutativeN/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            12. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            13. lower-neg.f6441.6

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                          5. Applied rewrites41.6%

                                                                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}} \]
                                                                                          6. Taylor expanded in F around 0

                                                                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                                          7. Step-by-step derivation
                                                                                            1. Applied rewrites30.7%

                                                                                              \[\leadsto \frac{-x}{B} \]
                                                                                          8. Recombined 2 regimes into one program.
                                                                                          9. Add Preprocessing

                                                                                          Alternative 26: 10.8% 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 77.4%

                                                                                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                                          2. 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. *-commutativeN/A

                                                                                              \[\leadsto \frac{\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} \cdot F} + \left(\mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            4. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}}{B} \]
                                                                                            5. lower-sqrt.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            6. lower-/.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            7. associate-+r+N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\left(2 + 2 \cdot x\right) + {F}^{2}}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            8. +-commutativeN/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{{F}^{2} + \left(2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            9. unpow2N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{F \cdot F} + \left(2 + 2 \cdot x\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            10. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(F, F, 2 + 2 \cdot x\right)}}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            11. +-commutativeN/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{2 \cdot x + 2}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            12. lower-fma.f64N/A

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \color{blue}{\mathsf{fma}\left(2, x, 2\right)}\right)}}, F, \mathsf{neg}\left(x\right)\right)}{B} \]
                                                                                            13. lower-neg.f6441.4

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, \color{blue}{-x}\right)}{B} \]
                                                                                          5. Applied rewrites41.4%

                                                                                            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -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 rewrites28.7%

                                                                                              \[\leadsto \frac{-1 - x}{B} \]
                                                                                            2. Taylor expanded in x around 0

                                                                                              \[\leadsto \frac{-1}{B} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites11.5%

                                                                                                \[\leadsto \frac{-1}{B} \]
                                                                                              2. Add Preprocessing

                                                                                              Reproduce

                                                                                              ?
                                                                                              herbie shell --seed 2024307 
                                                                                              (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))))))